Merge rows in Excel file using n8n action
PDF4me Merge Rows groups duplicate rows within one or more worksheets, keeps the first occurrence, and concatenates the remaining column values with a semicolon (duplicates removed automatically). Choose the worksheets to process, define which columns act as keys, and pick the output format. Great for customer order rollups, duplicate cleanup, or summarizing multi-entry logs.
Setup
Add the PDF4me “Merge Rows” node to your n8n workflow and configure the required parameters. For initial setup instructions, see our n8n Integration Guide.
Prerequisites
- PDF4me API credentials
- n8n workflow access
Configuration
- Add the PDF4me node to the workflow
- Select the "Merge rows in Excel file" action
- Provide the workbook source, worksheet list, and merge keys

Parameters
Important: Parameters marked with an asterisk (***) are required. Worksheet indexes in this action are 1-based.
| Parameter | Type | Description | Example |
|---|---|---|---|
| Input Data Type*** | String | Workbook source selector (Binary Data, Base64 String, URL). | Binary Data |
| Input Binary Field*** | Binary | Required when Binary Data is selected. | {{ $binary.data }} |
| Base64 Document Content*** | String | Required when Base64 String is selected. | UEsDBBQAAAA... |
| Document URL*** | String | Required when URL is selected. | https://files.example.com/orders.xlsx |
| File Name*** | String | Logical filename for reference. | orders.xlsx |
| Worksheet Numbers*** | String | Comma-separated worksheet indexes (1-based) to process. Example: 1,3. | 1,2 |
| Merge Key Columns | String | Comma-separated column indexes (1-based) used as grouping keys. Empty = compare whole rows (exact duplicates). | 1,2 |
| Output Format | String | Target format: XLSX (default), XLS, XLSB, or CSV. | XLSX |
| Binary Data Output Name*** | String | Binary slot that will hold the merged workbook. | document |
Output
Output Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
| fileName | String | Excel document filename with merged rows - The name of the output Excel document file after row merging | excel_merged_rows.xlsx |
| fileSize | Number | File size in bytes - The size of the Excel document in bytes after row merging | 224032 |
| success | Boolean | PDF4me operation status - Boolean flag indicating the success or failure of the row merging process. PDF4me returns true for successful operations and false for any errors | true |
| originalFileName | String | Original Excel document filename - The name of the input Excel document file | myExcelFile.xlsx |
| worksheetNumbers | String | Worksheet numbers processed - Comma-separated list of worksheet indexes (1-based) that were processed for row merging | 1,2 |
| mergeKeyColumns | String | Merge key columns used - Description of the merge key columns used. Shows "none specified" if whole rows were compared, or the column indexes if specific columns were used | none specified |
| outputFormat | String | Output file format - The format of the output file. Values: "XLSX", "XLS", "XLSB", "CSV" | XLSX |
| message | String | Operation message - Descriptive message indicating the result of the row merging operation, including the worksheet numbers processed | Successfully merged rows in Excel file from worksheets 1,2 |
N8N Action Response
The PDF4me Merge rows in Excel file API returns a response that can be viewed in multiple formats. Choose the view that best fits your needs:
- JSON
- Table
- Schema
- Binary
JSON Response Format
The raw JSON response from the API:
[
{
"fileName": "excel_merged_rows.xlsx",
"fileSize": 224032,
"success": true,
"originalFileName": "myExcelFile.xlsx",
"worksheetNumbers": "1,2",
"mergeKeyColumns": "none specified",
"outputFormat": "XLSX",
"message": "Successfully merged rows in Excel file from worksheets 1,2"
}
]
Table View
Response data in a structured table format:
| Parameter | Value |
|---|---|
| fileName | excel_merged_rows.xlsx |
| fileSize | 224032 |
| success | true |
| originalFileName | myExcelFile.xlsx |
| worksheetNumbers | 1,2 |
| mergeKeyColumns | none specified |
| outputFormat | XLSX |
| message | Successfully merged rows in Excel file from worksheets 1,2 |
Schema View
The data structure and types of the response:
1 item
fileName: T excel_merged_rows.xlsx
fileSize: # 224032
success: ☑ true
originalFileName: T myExcelFile.xlsx
worksheetNumbers: T 1,2
mergeKeyColumns: T none specified
outputFormat: T XLSX
message: T Successfully merged rows in Excel file from worksheets 1,2
Type Indicators:
T= String (Text)#= Number☑= Boolean[]= Array
Binary Data View
The actual Excel document file data and metadata:
data
─────────────────────────────
File Name: excel_merged_rows.xlsx
File Extension: xlsx
Mime Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
File Size: 224.0 kB
Binary Data Access:
- n8n Binary Object:
$binary.data.data - Base64 Content: Available for direct use
- File Operations: Ready for download, email, or storage
Use Cases
- Customer/order consolidation: Combine multiple transactions per customer into single summary rows.
- Duplicate cleanup: Remove exact duplicates from imported lead lists or exports.
- Inventory summaries: Merge entries by SKU/location and keep all quantity notes in one cell.