How can I compare same excel file with its previous version to check the data difference and print the output using Power Automate workflow?

Anonymous
2025-06-07T17:15:08+00:00

Suppose I have one excel file.

The file got updated, now I want to compare this new version with the old version of the worksheet.

I want to post only the "difference output" to the channel.

How can this be possible using Power Automate?

Explain actions that can make it easy to implement this workflow.

Microsoft 365 and Office | Excel | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Anonymous
    2025-06-07T18:42:19+00:00

    Hello Komal,  

    Welcome to the Microsoft Community! 

    I’m here to help you to compare Excel versions and post differences to a channel, it has some prerequisites: 

    Storage: Store both file versions in SharePoint/OneDrive for Business (version history enabled) 

    Permissions: Power Automate with Excel/SharePoint connectors 

    Excel Format: Structured data (tables preferred) with unique row identifiers 

    2. Power Automate Workflow 

    Action 1: Trigger 

    When a file is modified (SharePoint)  

    Set to monitor your Excel file's folder 

    Action 2: Get File Versions 

    Get file version history  

    • File identifier: Current file ID
    • Limit: 2 (current + previous version)

    Action 3: Extract Data 

    • List rows present in a table (Current version)
    • List rows present in a table (Previous version)  
      • Use the version-id from Action 2

    Action 4: Compare Data 

    Filter array (to find new/modified rows):  


     "value": "@{body('Get_rows_-_Current_Version')}", 
     "where": "@not(contains(body('Get_rows_-_Previous_Version'), item()))" 

    Action 5: Format Output 

    Create HTML table from filtered differences  

    Style with color-coding (red=removed, green=added) 

    Action 6: Post Results 

    Post adaptive card to Teams channel  

    • Include:  
      • Timestamp of changes
      • File name
      • HTML table of differences
      • Direct link to file

    3. Key Optimization Tips 

    • Delta Tracking: Use Modified timestamps to only check recent changes
    • Error Handling: Add a condition to check if versions exist
    • Scheduled Runs: Trigger daily via Recurrence action

    Note: Alternative for Non-Table Data if using raw ranges 

    1. Export both versions to CSV
    2. Use 'Data Operations - Join' to compare
    3. Apply 'Filter array' on mismatched columns

    Implementation Time: ~20-30 mins 

    Maintenance: Runs autonomously after setup  

    References:  

    Let me know if it works. Feel free to ask me anything you need! 

    Best regards,  

    Ryan-N-MSFT | Microsoft Community Support Specialist

    0 comments No comments
  2. Anonymous
    2025-06-09T06:32:26+00:00

    I am unable to find this action in the SharePoint (or on Excel) , is the name has been changed or any update is there ?

    Action 2: Get File Versions 

    Get file version history  

    • File identifier: Current file ID
    • Limit: 2 (current + previous version)
    0 comments No comments
  3. Anonymous
    2025-06-10T23:03:02+00:00

    Hi Komal 

    I understand you're looking for the "Get File Versions" action in SharePoint or Excel in Action 2, which might have been updated or renamed. Here are some steps to help you find and use this feature: 

    Step by step to check Version History in SharePoint: 

    • Open the SharePoint Library: Navigate to the document library where your file is stored.
    • Right-Click on the File: Right-click on the file you want to check.
    • Select "Version History": From the context menu, select "Version History". This will show you a list of all versions of the file 1.

    If you need any further assistance, please don’t hesitate to reach out, feel free to ask me anything you need!  

    Best regards,  

    Ben-V-MSFT | Microsoft Community Support Specialist

    0 comments No comments