I'm working on a Power Automate flow that compares data between a table (updated daily via a CSV file) and a SharePoint list to flag differences. After I clean up the table data using Power Query, the dataflow refresh triggers my flow. The goal is to keep the SharePoint list updated by:
- Adding new items from the table that aren't on the SharePoint list.
- Marking items as inactive if they’re no longer in the table.
- Updating existing items if any changes are made to them.
My SharePoint list has about 500 items, and the table has around 300 records. I compare the Property ID from the table with the Property ID in the SharePoint list.
The issue is that I believe the way I set it up is inefficient, causing 500 x 300 = 150,000 comparisons, which makes the flow take a long time to run. I think the flow is looping through each item in the SharePoint list and comparing it with every item in the table, slowing things down.
Questions:
- Am I doing something wrong with my flow?
- Is there better methods that I am not aware of?
- Is there a better, more efficient way to perform this comparison?