Skip to main content

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.

Compare Documents Power Automate

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

ParameterTypeDescriptionExample
Operation/firstDocument/Name***StringFirst 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***Base64First 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***StringSecond 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***Base64Second 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)

ParameterTypeDescriptionExample
Operation/comparisonOptions/IgnoreFormattingBooleanIgnore 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/IgnoreCaseChangesBooleanIgnore 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/IgnoreCommentsBooleanIgnore 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/IgnoreTablesBooleanIgnore 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/IgnoreFieldsBooleanIgnore 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/IgnoreFootnotesBooleanIgnore 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/IgnoreTextboxesBooleanIgnore 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/IgnoreHeadersAndFootersBooleanIgnore 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/AuthorStringComparison 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 View

Response data in a structured table format:

ParameterTypeDescription
documentBase64Word document with comparison results and tracked changes
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 document comparison workflows:

Error MessageCauseSolution
"First document is empty"First document content is null or emptyProvide valid base64-encoded content for the first document
"Second document is empty"Second document content is null or emptyProvide valid base64-encoded content for the second document
"Error comparing documents"General exception during document comparisonCheck document formats, ensure both are valid Word documents, review exception details in Errors array
"Error loading document from bytes"Invalid or corrupted Word documentVerify both input documents are valid Word files (.docx)
"ArgumentNullException: doc1"First document is nullEnsure first document is properly loaded
"ArgumentNullException: doc2"Second document is nullEnsure second document is properly loaded
"ArgumentNullException: options"Comparison options are nullProvide valid comparison options object

Workflow Examples

The PDF4me Compare Documents action in Power Automate provides comprehensive workflow templates designed for real-world business scenarios:

Automated Contract Version Comparison Workflow

Streamline your legal document review with automated contract comparison:

Complete Workflow Steps:

  1. Trigger: New contract version uploaded to SharePoint legal folder
  2. Get Original Contract: Retrieve original contract from document library
  3. Get Modified Contract: Retrieve new contract version from upload
  4. Compare Documents: Compare original vs. modified contract
  5. Set Options: IgnoreFormatting = No, IgnoreCaseChanges = No, IgnoreComments = No
  6. Set Author: Author = "Legal Review System"
  7. Email Legal Team: Send comparison results to legal team for review
  8. 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

Industry Use Cases & Applications

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

Get Help