Compare Documents in Power Automate
PDF4me Compare Documents action enables comparing two Word documents and tracking changes with comprehensive comparison options in Power Automate. This powerful document comparison feature supports detailed change tracking, customizable comparison settings, revision management, and professional comparison reports with full control over formatting, case sensitivity, comments, tables, fields, footnotes, textboxes, and headers/footers, perfect for document review, version control, and collaborative editing 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 comparison services.

Key Features
- Document Comparison: Compare two Word documents and identify all differences
- Track Changes: Generate documents with tracked changes showing modifications
- Customizable Options: Control what types of changes to track or ignore
- Revision Management: Clean up existing revisions before comparison
- Author Attribution: Assign changes to specific authors for accountability
- Professional Output: Generate clean comparison documents with revision tracking
- Multiple Format Support: Compare .docx and .doc files
- Advanced Filtering: Ignore formatting, case changes, comments, tables, and more
Parameters
Complete list of parameters for the Compare Documents action. Configure these parameters to control document comparison behavior.
Important: Parameters marked with an asterisk (***) are required. Advanced parameters provide fine-grained control over comparison options.
Document Input Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
| Operation/firstDocument/Name*** | String | First Document Name • Name of the first (base) document • Used for reference and processing • Must include proper file extension (.docx, .doc) • Supports dynamic naming from flow variables • This document serves as the base for comparison | original.docx |
| Operation/firstDocContent*** | Base64 | First Document Content • Base64-encoded content of the first 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] |
| Operation/secondDocument/Name*** | String | Second Document Name • Name of the second (comparison) document • Used for reference and processing • Must include proper file extension (.docx, .doc) • Supports dynamic naming from flow variables • This document is compared against the first | modified.docx |
| Operation/secondDocContent*** | Base64 | Second Document Content • Base64-encoded content of the second 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] |
Advanced Parameters (Comparison Options)
| Parameter | Type | Description | Example |
|---|---|---|---|
| Operation/comparisonOptions/IgnoreFormatting | Boolean | Ignore Formatting Changes • Yes - Ignore formatting changes (bold, italic, font, color, etc.) • No - Track formatting changes (default) • Useful when only content changes matter • Reduces noise in comparison results | No |
| Operation/comparisonOptions/IgnoreCaseChanges | Boolean | Ignore Case Changes • Yes - Ignore case changes ("Hello" vs "HELLO") • No - Track case changes (default) • Useful for case-insensitive comparisons • Treats "Hello" and "hello" as identical | No |
| Operation/comparisonOptions/IgnoreComments | Boolean | Ignore Comments • Yes - Ignore comment changes and additions • No - Track comment changes (default) • Useful when comments are not relevant • Focuses comparison on document content only | No |
| Operation/comparisonOptions/IgnoreTables | Boolean | Ignore Table Changes • Yes - Ignore table structure and content changes • No - Track table changes (default) • Useful when tables are not part of comparison • Focuses on text content only | No |
| Operation/comparisonOptions/IgnoreFields | Boolean | Ignore Field Changes • Yes - Ignore field updates (dates, formulas, cross-references) • No - Track field changes (default) • Useful when fields auto-update • Prevents false positives from field updates | No |
| Operation/comparisonOptions/IgnoreFootnotes | Boolean | Ignore Footnote Changes • Yes - Ignore footnote content and formatting changes • No - Track footnote changes (default) • Useful when footnotes are not relevant • Focuses comparison on main document content | No |
| Operation/comparisonOptions/IgnoreTextboxes | Boolean | Ignore Textbox Changes • Yes - Ignore textbox content and positioning changes • No - Track textbox changes (default) • Useful when textboxes are not part of comparison • Focuses on main document flow | No |
| Operation/comparisonOptions/IgnoreHeadersAndFooters | Boolean | Ignore Header/Footer Changes • Yes - Ignore header and footer content changes • No - Track header/footer changes (default) • Useful when headers/footers are not relevant • Focuses comparison on document body | No |
| Operation/comparisonOptions/Author | String | Comparison Author • Author name for tracked changes • Default: "Comparison" • Used to attribute changes in the result document • Helps identify who performed the comparison • Can be dynamic from flow variables | John Doe |
Output
The PDF4me Compare 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 | Word document with comparison results and tracked changes |
| 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 Comparison Results]",
"Success": true,
"ErrorMessage": null,
"Errors": []
}
Error Response Example:
{
"document": null,
"Success": false,
"ErrorMessage": "First document is empty",
"Errors": [
{
"Code": "DOCUMENT_ERROR",
"Message": "The first document content is null or empty"
}
]
}
Power Automate Flow Usage
Use comparison results in subsequent actions:
- Document Review: Send comparison results to reviewers for approval
- Change Tracking: Track document modifications over time
- Version Control: Maintain document version history with changes
- Collaborative Editing: Merge changes from multiple contributors
- Quality Assurance: Review changes before final approval
- Audit Trail: Maintain records of document modifications
Common Error Messages
Understanding and troubleshooting errors helps ensure smooth document comparison workflows:
| Error Message | Cause | Solution |
|---|---|---|
| "First document is empty" | First document content is null or empty | Provide valid base64-encoded content for the first document |
| "Second document is empty" | Second document content is null or empty | Provide valid base64-encoded content for the second document |
| "Error comparing documents" | General exception during document comparison | Check document formats, ensure both are valid Word documents, review exception details in Errors array |
| "Error loading document from bytes" | Invalid or corrupted Word document | Verify both input documents are valid Word files (.docx) |
| "ArgumentNullException: doc1" | First document is null | Ensure first document is properly loaded |
| "ArgumentNullException: doc2" | Second document is null | Ensure second document is properly loaded |
| "ArgumentNullException: options" | Comparison options are null | Provide valid comparison options object |
Workflow Examples
The PDF4me Compare Documents action in Power Automate provides comprehensive workflow templates designed for real-world business scenarios:
- Contract Review
- Policy Updates
- Proposal Review
- Technical Documentation
Automated Contract Version Comparison Workflow
Streamline your legal document review with automated contract comparison:
Complete Workflow Steps:
- Trigger: New contract version uploaded to SharePoint legal folder
- Get Original Contract: Retrieve original contract from document library
- Get Modified Contract: Retrieve new contract version from upload
- Compare Documents: Compare original vs. modified contract
- Set Options: IgnoreFormatting = No, IgnoreCaseChanges = No, IgnoreComments = No
- Set Author: Author = "Legal Review System"
- Email Legal Team: Send comparison results to legal team for review
- Archive Results: Store comparison document in legal review folder
Business Benefits:
- Compares 50+ contract versions monthly automatically
- Identifies all changes between contract versions
- Reduces legal review time by 60%
- Ensures no changes are missed during review
Automated Policy Document Comparison Workflow
Enhance your policy management with automated document comparison:
Complete Workflow Steps:
- Trigger: Policy document updated in SharePoint policy library
- Get Previous Version: Retrieve previous policy version from version history
- Get Current Version: Retrieve updated policy document
- Compare Documents: Compare previous vs. current policy
- Set Options: IgnoreFormatting = Yes, IgnoreCaseChanges = Yes, IgnoreComments = No
- Set Author: Author = "Policy Management System"
- Email Stakeholders: Send comparison results to policy stakeholders
- Update Change Log: Log policy changes in compliance tracking system
Business Benefits:
- Tracks 30+ policy updates quarterly automatically
- Identifies substantive changes vs. formatting updates
- Maintains compliance audit trail
- Reduces manual policy review time by 70%
Automated Proposal Version Comparison Workflow
Optimize your proposal management with automated version comparison:
Complete Workflow Steps:
- Trigger: Proposal updated in SharePoint proposals folder
- Get Draft Version: Retrieve previous proposal draft
- Get Updated Version: Retrieve current proposal version
- Compare Documents: Compare draft vs. updated proposal
- Set Options: IgnoreFormatting = No, IgnoreTables = No, IgnoreComments = No
- Set Author: Author = "Proposal Review Team"
- Email Review Team: Send comparison results to proposal reviewers
- Track Changes: Log proposal modifications in project management system
Business Benefits:
- Compares 100+ proposal versions monthly automatically
- Ensures all proposal changes are tracked and reviewed
- Improves proposal quality through change tracking
- Reduces proposal review cycle time by 50%
Automated Technical Document Comparison Workflow
Enhance your technical documentation with automated version comparison:
Complete Workflow Steps:
- Trigger: Technical document updated in SharePoint docs library
- Get Previous Version: Retrieve previous documentation version
- Get Current Version: Retrieve updated documentation
- Compare Documents: Compare previous vs. current documentation
- Set Options: IgnoreFormatting = Yes, IgnoreFields = Yes, IgnoreComments = No
- Set Author: Author = "Technical Writing Team"
- Email Technical Team: Send comparison results to technical reviewers
- Update Documentation: Merge approved changes into master documentation
Business Benefits:
- Compares 75+ technical documents monthly automatically
- Tracks documentation changes across multiple versions
- Ensures technical accuracy through change review
- Maintains documentation consistency and quality
Industry Use Cases & Applications
- Legal & Professional Services
- Finance & Accounting
- Sales & Marketing
- Human Resources
- Healthcare & Medical
- Education & Research
Legal & Professional Services Use Cases
- Contract Review: Compare contract versions to identify changes and modifications
- Legal Document Updates: Track changes in legal briefs, agreements, and court documents
- Compliance Monitoring: Compare policy documents to ensure regulatory compliance
- Client Document Review: Track changes in client-facing legal documents
Finance & Accounting Use Cases
- Financial Report Updates: Compare quarterly and annual financial reports
- Budget Document Changes: Track modifications in budget proposals and reports
- Audit Documentation: Compare audit reports across different periods
- Regulatory Filings: Track changes in regulatory submission documents
Sales & Marketing Use Cases
- Proposal Management: Compare proposal versions to track client requirements
- Marketing Material Updates: Track changes in marketing collateral and campaigns
- Pricing Document Changes: Compare pricing sheets and rate cards
- Client Presentation Updates: Track modifications in client presentation materials
Human Resources Use Cases
- Policy Document Updates: Compare HR policy versions and updates
- Employee Handbook Changes: Track modifications in employee handbooks
- Job Description Updates: Compare job descriptions across different versions
- Training Material Changes: Track updates in training documentation
Healthcare & Medical Use Cases
- Medical Protocol Updates: Compare medical procedure and protocol documents
- Patient Care Guidelines: Track changes in patient care documentation
- Research Documentation: Compare research protocols and study documents
- Compliance Documentation: Track changes in healthcare compliance materials
Education & Research Use Cases
- Curriculum Updates: Compare curriculum documents across different versions
- Research Proposal Changes: Track modifications in research proposals
- Academic Policy Updates: Compare academic policy documents
- Student Handbook Changes: Track updates in student handbooks and guidelines