Merge Documents in Power Automate
PDF4me Merge Documents action enables combining multiple Word documents into a single document in Power Automate with advanced formatting and compliance options. This powerful document merging feature supports flexible document ordering, customizable formatting modes, compliance level settings, timezone metadata, and intelligent style handling with full control over merge behavior, perfect for document assembly, report consolidation, and content management workflows across Microsoft 365.
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 Word document merging services.

Key Features
- Multiple Document Support: Merge unlimited number of Word documents into one
- Flexible Ordering: Control merge order with customizable SortPosition values
- Formatting Options: Choose how to handle styles during merge process
- Compliance Settings: Apply different compliance levels (ECMA, Transitional, Strict)
- Timezone Metadata: Add timezone information for document tracking
- Style Management: Intelligent handling of document styles and formatting
- Base Document Concept: First document becomes the foundation for merging
- Metadata Preservation: Maintain document properties and custom metadata
Parameters
Complete list of parameters for the Merge Documents action. Configure these parameters to control document merging behavior.
Important: Parameters marked with an asterisk (***) are required. The Documents array must contain at least one document with all required properties.
Documents to Merge
| Parameter | Type | Description | Example |
|---|---|---|---|
| Documents*** | Array | Array of Documents to Merge • Array of document objects to be merged • Must contain at least one document • Documents are merged in SortPosition order • Each document object requires Filename, DocContent, and SortPosition • FormatMode is optional for each document | [{"Filename": "doc1.docx", "DocContent": "...", "SortPosition": 0}] |
| Documents[].Filename*** | String | Document Filename • Original filename of the document • Used for reference and processing • Must include proper file extension (.docx, .doc) • Supports dynamic naming from flow variables • Used for document identification during merge | "document1.docx" |
| Documents[].DocContent*** | Base64 | Document Content • Base64-encoded content of the document • Map from previous action output or file upload • Supports Word files from SharePoint, Dropbox, OneDrive, email attachments • Can be dynamically retrieved from flow variables • Direct base64 can be given in the file content also • Must be valid Word document (.docx, .doc formats) | [File Content from Get File] |
| Documents[].SortPosition*** | Number (int) | Merge Order Position • Position in merge order (0-based or custom numbering) • Documents are merged in ascending SortPosition order • Lowest SortPosition becomes the base document • Must be unique within the Documents array • Can use any numbering scheme (0,1,2 or 10,20,30) | 0 |
| Documents[].FormatMode | String | Formatting Mode • KeepSourceFormatting - Preserves original formatting from source document (default) • KeepDifferentStyles - Keeps different styles, merges similar ones • UseDestinationStyles - Uses formatting from the destination document • Controls how styles are handled during merge | "KeepSourceFormatting" |
Advanced Parameters (Merge Options)
| Parameter | Type | Description | Example |
|---|---|---|---|
| Merge Options Time Zone | String | Document Timezone • Time zone for document metadata (e.g., "UTC", "Asia/Kolkata", "America/New_York") • Added as custom document property • Used for document tracking and compliance • Supports standard timezone identifiers • Default: null (no timezone metadata) | "UTC" |
| Merge Options Compliance Level | String | Document Compliance Level • ECMA - ECMA-376 2006 standard compliance • Transitional - ISO 29500:2008 Transitional compliance (default) • Strict - ISO 29500:2008 Strict compliance • Custom - Custom compliance level • Affects document OOXML compliance | "Transitional" |
Document Merge Order:
- Documents are merged in ascending SortPosition order
- Document with lowest SortPosition becomes the base document
- All other documents are appended to the base document
- SortPosition values can be any integers (0,1,2 or 10,20,30)
Output
The PDF4me Merge Documents action returns comprehensive output data for seamless Power Automate flow integration:
- Table
- JSON
- Flow Integration
Table View
Response data in a structured table format:
| Parameter | Type | Description |
|---|---|---|
| document | Base64 | Merged Word document containing all input documents |
| Success | Boolean | true if operation successful, false if failed |
| Error Message | String | Error description (null if successful) |
| Errors | Array | List of detailed error information (empty array if successful) |
JSON Response Format
The raw JSON response from the action:
{
"document": "[Base64 Word Content with Merged Documents]",
"Success": true,
"ErrorMessage": null,
"Errors": []
}
Error Response Example:
{
"document": null,
"Success": false,
"ErrorMessage": "No documents to merge",
"Errors": [
{
"Code": "VALIDATION_ERROR",
"Message": "Documents array is null or empty"
}
]
}
Power Automate Flow Usage
Use merged documents in subsequent actions:
- Document Assembly: Combine multiple documents into comprehensive reports
- Report Consolidation: Merge chapter documents into complete reports
- Template Assembly: Combine template sections into final documents
- Content Management: Consolidate content from multiple sources
- Email Distribution: Send merged documents to stakeholders
- Archive Storage: Store consolidated documents in document libraries
Common Error Messages
Understanding and troubleshooting errors helps ensure smooth document merging workflows:
| Error Message | Cause | Solution |
|---|---|---|
| "Request is empty" | Request object is null | Provide valid request object |
| "No documents to merge" | Documents array is null or empty | Provide at least one document in the Documents array |
| "Error merging documents" | General exception during document merging | Check document formats, ensure all are valid Word documents, review exception details in Errors array |
| "Error loading document from bytes" | Invalid or corrupted Word document | Verify all input documents are valid Word files (.docx) |
| "Unknown FormatMode, defaulting to KeepSourceFormatting" | Invalid FormatMode value provided | Use valid FormatMode values: KeepSourceFormatting, KeepDifferentStyles, UseDestinationStyles |
Workflow Examples
The PDF4me Merge Documents action in Power Automate provides comprehensive workflow templates designed for real-world business scenarios:
- Report Assembly
- Contract Assembly
- Proposal Consolidation
- Manual Consolidation
Automated Report Assembly Workflow
Streamline your report generation with automated document merging:
Complete Workflow Steps:
- Trigger: All report sections completed in SharePoint report folder
- Get Cover Page: Retrieve cover page document (SortPosition = 0)
- Get Executive Summary: Retrieve executive summary (SortPosition = 1)
- Get Main Content: Retrieve main report content (SortPosition = 2)
- Get Appendices: Retrieve appendix documents (SortPosition = 3)
- Merge Documents: Combine all sections in proper order
- Set Formatting: FormatMode = "KeepSourceFormatting" for all documents
- Set Compliance: Compliance Level = "Transitional" for standard compliance
- Email Final Report: Send merged report to stakeholders
- Archive Report: Store final report in reports library
Business Benefits:
- Assembles 50+ monthly reports automatically
- Ensures consistent report structure and formatting
- Reduces manual report assembly time by 80%
- Eliminates errors in report section ordering
Automated Contract Assembly Workflow
Enhance your legal document management with automated contract merging:
Complete Workflow Steps:
- Trigger: Contract sections completed in SharePoint legal folder
- Get Contract Header: Retrieve contract header (SortPosition = 0)
- Get Terms & Conditions: Retrieve terms section (SortPosition = 1)
- Get Specific Clauses: Retrieve clause documents (SortPosition = 2)
- Get Signature Pages: Retrieve signature pages (SortPosition = 3)
- Merge Documents: Combine all contract sections
- Set Formatting: FormatMode = "KeepSourceFormatting" for legal formatting
- Set Compliance: Compliance Level = "Strict" for legal compliance
- Set Timezone: Time Zone = "UTC" for international contracts
- Email Legal Team: Send assembled contract for review
Business Benefits:
- Assembles 100+ contracts monthly automatically
- Ensures proper contract section ordering
- Maintains legal document formatting standards
- Reduces contract assembly time by 90%
Automated Proposal Consolidation Workflow
Optimize your proposal management with automated document consolidation:
Complete Workflow Steps:
- Trigger: Proposal sections completed in SharePoint proposals folder
- Get Proposal Cover: Retrieve proposal cover page (SortPosition = 0)
- Get Technical Section: Retrieve technical proposal (SortPosition = 1)
- Get Financial Section: Retrieve financial proposal (SortPosition = 2)
- Get References: Retrieve reference documents (SortPosition = 3)
- Merge Documents: Combine all proposal sections
- Set Formatting: FormatMode = "UseDestinationStyles" for consistent branding
- Set Compliance: Compliance Level = "Transitional" for client compatibility
- Email Client: Send consolidated proposal to client
- Archive Proposal: Store final proposal in client deliverables folder
Business Benefits:
- Consolidates 75+ proposals monthly automatically
- Ensures consistent proposal formatting and branding
- Reduces proposal consolidation time by 85%
- Maintains professional proposal presentation
Automated Manual Consolidation Workflow
Enhance your documentation management with automated manual merging:
Complete Workflow Steps:
- Trigger: Manual sections updated in SharePoint documentation folder
- Get Table of Contents: Retrieve TOC document (SortPosition = 0)
- Get Introduction: Retrieve introduction section (SortPosition = 1)
- Get Procedure Sections: Retrieve procedure documents (SortPosition = 2-5)
- Get Reference Materials: Retrieve reference documents (SortPosition = 6)
- Merge Documents: Combine all manual sections
- Set Formatting: FormatMode = "KeepDifferentStyles" for section variety
- Set Compliance: Compliance Level = "ECMA" for broad compatibility
- Set Timezone: Time Zone = "America/New_York" for local tracking
- Publish Manual: Upload consolidated manual to documentation portal
Business Benefits:
- Consolidates 25+ manuals quarterly automatically
- Maintains section-specific formatting and styles
- Reduces manual consolidation time by 95%
- Ensures consistent documentation structure
Industry Use Cases & Applications
- Legal & Professional Services
- Finance & Accounting
- Sales & Marketing
- Human Resources
- Healthcare & Medical
- Education & Research
Legal & Professional Services Use Cases
- Contract Assembly: Combine contract sections into complete legal documents
- Legal Brief Consolidation: Merge multiple brief sections into comprehensive legal briefs
- Compliance Documentation: Consolidate compliance documents for regulatory submissions
- Client Document Assembly: Combine client-specific documents into complete packages
Finance & Accounting Use Cases
- Financial Report Assembly: Merge financial report sections into complete reports
- Audit Documentation: Consolidate audit documents for comprehensive audit reports
- Budget Consolidation: Combine budget sections from different departments
- Regulatory Filing Assembly: Merge regulatory documents for submission
Sales & Marketing Use Cases
- Proposal Assembly: Combine proposal sections into complete client proposals
- Marketing Material Consolidation: Merge marketing documents for campaigns
- Sales Presentation Assembly: Combine presentation sections into complete presentations
- Client Deliverable Assembly: Consolidate client-specific materials
Human Resources Use Cases
- Employee Handbook Assembly: Combine handbook sections into complete employee handbooks
- Policy Document Consolidation: Merge policy documents for comprehensive policy manuals
- Training Material Assembly: Combine training sections into complete training materials
- Compliance Manual Assembly: Consolidate compliance documents for employee reference
Healthcare & Medical Use Cases
- Medical Report Assembly: Combine medical report sections into complete patient reports
- Protocol Documentation: Merge protocol sections into comprehensive medical protocols
- Research Documentation: Consolidate research documents for study reports
- Compliance Manual Assembly: Combine healthcare compliance documents
Education & Research Use Cases
- Academic Paper Assembly: Combine research sections into complete academic papers
- Curriculum Consolidation: Merge curriculum sections into complete course materials
- Research Report Assembly: Combine research sections into comprehensive reports
- Student Manual Assembly: Consolidate student materials into complete handbooks