cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Questions
Helper I
Helper I

Performance: Compare two SPO lists and add missing items to the second list (join better than apply to each)?

I have two lists (both are in SPO now but later the source will be in SQL server).

I want to look at items in the SourceList and compare it to items in the TargetList.  Any items in SourceList and NOT in TargetList I want to add to TargetList.

I've seen solutions like this: https://tomriha.com/how-to-check-if-sharepoint-item-already-exists-in-power-automate/  however, they seem to rely on a loop that reads the SourceList and then checks the TargetList one item at a time.

If I used the JOIN() function would that be more performant?  I'm concerned about what happens when the list size starts to grow.

Thank you!

2 REPLIES 2
Hardesh15
Super User
Super User

@Questions  That is why Tom is using filter query in that post. Though it applies loop but only for filtered items so that it executes faster.

Please 'Thumbs Up' the posts that helped you and 'Accept as Solution' if my post answered your question.

@Hardesh /Gopenly.in

Thank you.

When I attempt to construct the Filter Query it wraps my Get Items step in an "Apply to each"

Questions_0-1660854936465.png

Questions_1-1660854955855.png

What am I doing wrong?

I want to follow his example which was to Get items from my target list and then use those to filter my source list (so I only return rows that are not already in the target).

Thank you

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (1,261)