web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Compare 2 excel files ...
Power Automate
Unanswered

Compare 2 excel files and update when ther is a match. Add row if there is no match

(0) ShareShare
ReportReport
Posted on by

Hi,

so I have to Excel files (Workbooks with tables). One is the file (excel1) that can be edited which schould update the master-file (excel2). So in my flow, I list rows in both tables and then compare the unique colums. But as soon as I add the condition to the flow, a new "apply to each" action is automatically added and therefore creates an indefinate loop. Is there any solution to my problem? Or maybe another way to compare and update?

 

Thank you in advance!

 

tay_liz_0-1659015789014.png

 

Categories:
I have the same question (0)
  • ScottShearer Profile Picture
    25,294 Most Valuable Professional on at

    @tay_liz 

    Is the end result that the two files are to be identical?  If so, why not just delete Excel 2 and create a new Excel 2 with the same name using the file content of Excel 1?

  • takolota1 Profile Picture
    4,980 Moderator on at

    It would be better to use some Filter array action conditional to check if an array of the primary keys from the master file contains each primary key of your new file.

    That single action would then return every item in the new file that needs to be updated with an item from the new file.

    You would use the same set-up, but set the Filter array conditional to Does not contain to get the new records to create.

    That would avoid any loops for the checks and be much more efficient.

     

    And to get an array of just the primary keys from the master file, you can use the Select action on the master file outputs.

    You can then use the setting on the right side of the Select to change the table to an empty box input where you can insert an expression

    item()[‘InsertPrimaryKeyColumnName’]

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 229 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 227

#3
Haque Profile Picture

Haque 181

Last 30 days Overall leaderboard