Skip to main content

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

  1. Add the PDF4me node to the workflow
  2. Select the "Merge rows in Excel file" action
  3. Provide the workbook source, worksheet list, and merge keys
Merge Rows in Excel

Parameters

Important: Parameters marked with an asterisk (***) are required. Worksheet indexes in this action are 1-based.

ParameterTypeDescriptionExample
Input Data Type***StringWorkbook source selector (Binary Data, Base64 String, URL).Binary Data
Input Binary Field***BinaryRequired when Binary Data is selected.{{ $binary.data }}
Base64 Document Content***StringRequired when Base64 String is selected.UEsDBBQAAAA...
Document URL***StringRequired when URL is selected.https://files.example.com/orders.xlsx
File Name***StringLogical filename for reference.orders.xlsx
Worksheet Numbers***StringComma-separated worksheet indexes (1-based) to process. Example: 1,3.1,2
Merge Key ColumnsStringComma-separated column indexes (1-based) used as grouping keys. Empty = compare whole rows (exact duplicates).1,2
Output FormatStringTarget format: XLSX (default), XLS, XLSB, or CSV.XLSX
Binary Data Output Name***StringBinary slot that will hold the merged workbook.document

Output

Output Parameters

ParameterTypeDescriptionExample
fileNameStringExcel document filename with merged rows - The name of the output Excel document file after row mergingexcel_merged_rows.xlsx
fileSizeNumberFile size in bytes - The size of the Excel document in bytes after row merging224032
successBooleanPDF4me operation status - Boolean flag indicating the success or failure of the row merging process. PDF4me returns true for successful operations and false for any errorstrue
originalFileNameStringOriginal Excel document filename - The name of the input Excel document filemyExcelFile.xlsx
worksheetNumbersStringWorksheet numbers processed - Comma-separated list of worksheet indexes (1-based) that were processed for row merging1,2
mergeKeyColumnsStringMerge 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 usednone specified
outputFormatStringOutput file format - The format of the output file. Values: "XLSX", "XLS", "XLSB", "CSV"XLSX
messageStringOperation message - Descriptive message indicating the result of the row merging operation, including the worksheet numbers processedSuccessfully 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 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"
}
]

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.

Get Help