Skip to main content

Merge Rows in Excel in Power Automate

PDF4me Merge Rows in Excel action enables intelligent consolidation of duplicate rows in Excel documents by grouping based on key columns in Power Automate with automatic value merging. This powerful data consolidation feature identifies duplicate rows using specified key columns (or all columns), combines values from non-key columns using semicolon-separated format, removes duplicate values within merged cells, and supports multiple output formats (XLSX, XLS, XLSB, CSV), perfect for customer order consolidation, data deduplication, category aggregation, and multi-row record combination across Microsoft 365 workflows.

Authenticating Your API Request

To access the PDF4me Web API through Power Automate, every request must include proper authentication credentials. Authentication ensures secure communication and validates your identity as an authorized user, enabling seamless integration between your Power Automate flows and PDF4me's powerful Excel row merging services.

Merge Rows in Excel Power Automate

Key Features

  • Intelligent Row Grouping: Group duplicate rows based on specified key columns
  • Value Consolidation: Merge values from non-key columns with semicolon separator
  • Duplicate Detection: Automatically identify and consolidate duplicate records
  • Multiple Worksheet Support: Process multiple worksheets in single operation
  • Flexible Key Selection: Use specific columns as keys or all columns for exact duplicates
  • Multiple Output Formats: Save as XLSX, XLS, XLSB, or CSV

Parameters

Complete list of parameters for the Merge Rows in Excel action. Configure these parameters to control row merging.

Important: Parameters marked with an asterisk (***) are required. Both worksheet and column numbers use 1-based indexing (1 = first worksheet, 1 = column A).

ParameterTypeDescriptionExample
File Content***Base64Source Excel File Content
• Map Excel file from previous action output
• Supports Excel files from SharePoint, OneDrive, email attachments
• Can be dynamically retrieved from flow variables
• Must be valid Excel document (.xlsx, .xls formats)
[File Content from Get File]
File Name***StringExcel Document Name
• Specify Excel file name with extension (.xlsx, .xls)
• Used for processing and output file naming
• Must include proper file extension
• Supports dynamic naming from flow variables
data.xlsx
Worksheet Numbers***StringComma-Separated Worksheet Numbers (1-based)
• List of worksheet numbers to process
• Format: "1,2,3" (1 = first worksheet)
• Required - at least one worksheet
• 1-based indexing
1,3,5
Merge Key ColumnsStringComma-Separated Key Column Numbers (1-based)
• Columns to use as merge keys (1 = column A, 2 = column B, etc.)
Key columns: Identify duplicate rows - values from first occurrence kept
Value columns (non-key): Get merged with "; " separator - duplicate values removed
Empty = all columns: Removes exact duplicate rows only (no value merging)
Merge Logic: Collects non-empty values from duplicates → Removes duplicate values → Joins with "; "
• 1-based indexing
1,2
Output FormatStringOutput File Format
"XLSX" - Excel 2007+ (.xlsx) - Default, best compatibility
"XLS" - Excel 97-2003 (.xls) - Legacy system compatibility
"XLSB" - Excel Binary Workbook (.xlsb) - Faster performance, smaller file size
"CSV" - Comma-separated values (.csv) - Simple format, data import
• Case-insensitive, output filename: "merged_rows" with appropriate extension
XLSX

Output

The PDF4me Merge Rows in Excel action returns comprehensive output data for seamless Power Automate flow integration:

Table View

Response data in a structured table format:

ParameterTypeDescription
documentBase64Excel document with merged rows
FileNameStringOutput filename: "merged_rows.xlsx" (or .xls, .xlsb, .csv based on format)
SuccessBooleantrue if operation successful, false if failed
Error MessageStringError description (null if successful)
ErrorsArrayList of detailed error information (empty array if successful)

Common Error Messages

Understanding and troubleshooting errors helps ensure smooth Excel row merging workflows:

Error MessageCauseSolution
"Request is empty"Request object is nullProvide valid request object
"Document is empty"Document object is nullProvide valid Excel document
"Invalid worksheet selection"Worksheet number out of range or invalid formatUse valid worksheet numbers (1-based) within workbook
"Available worksheets in workbook (X total)"Informational message when worksheet validation failsUse worksheet numbers from 1 to X
"Worksheet {number} not found"Worksheet number exceeds total worksheet countUse valid worksheet numbers (1 to total count)
"Error processing file: {message}"Generic processing error during merge operationCheck file integrity, data structure, and parameter values

Workflow Examples

The PDF4me Merge Rows in Excel action in Power Automate provides comprehensive workflow templates designed for real-world business scenarios:

Automated Customer Order Consolidation Workflow

Transform your customer reporting with automated order consolidation by customer:

Complete Workflow Steps:

  1. Trigger: Daily order export completed at 11 PM
  2. Get Order Export: Retrieve daily orders Excel from SharePoint
  3. Merge by Customer: Set MergeKeyColumns = "1" (CustomerID column)
  4. Target Worksheet: WorksheetNumbers = "1" (Orders sheet)
  5. Set Output: OutputFormat = "XLSX"
  6. Process Merge: Consolidate all orders per customer
  7. Result: One row per customer with all OrderIDs, Products, Amounts merged
  8. Email Sales: Send consolidated customer view to sales team
  9. Archive: Store in daily consolidated reports folder

Business Benefits:

  • Consolidates 200+ daily orders into customer-level summary
  • Provides single-row view of all customer purchases
  • Simplifies sales analysis with deduplicated customer data
  • Reduces report complexity by 70% while preserving all information

Industry Use Cases & Applications

Sales & E-Commerce Use Cases

  • Customer Order Consolidation: Merge multiple orders per customer into single rows
  • Product Sales Aggregation: Consolidate sales by product across multiple transactions
  • Territory Rollup: Merge sales data by territory or region
  • Duplicate Lead Removal: Remove exact duplicate leads from marketing lists

Get Help