Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - General Discussion
Unanswered

Compare 2 Sharepoint Lists (with a reference column) and then update records & create item if it doesnt exist

(0) ShareShare
ReportReport
Posted on by 32

Hi all, I've been scratching my head on this for a while, I've only made it work in the very slow inefficient way with 10000+ API calls and 1-4hr Flow run times.

 

I have 2 Sharepoint lists.

 

List 'A' is a live list that is in constant use and is for capturing data inputs. It has a UniqueID calculated column in the format of MM/dd/yyyy&OrderNumber. i.e: 04/30/20232056

 

List 'B' is a source list that gets updated weekly with true data. It has the same UniqueID calculated column with the format of MM/dd/yyyy&OrderNumber. i.e: 04/30/20232056

 

I now need to match items in the lists on this 'UniqueID' value, and then update List 'A' with extra data from List 'B'. The data in question that needs updating is timestamp data such as order placed, order fulfilled etc etc. Plus I need to do these features:

  • If an Item is found in 'A' and not 'B', it needs deleting
  • If an Item is found in 'B' and not 'A', it needs a record creating in List 'A'

I don't know the best way of doing this, but I know looping through nested For Each loops is not the best way to do it.


Any help would be great!

  • OJBridger Profile Picture
    32 on at
    Re: Compare 2 Sharepoint Lists (with a reference column) and then update records & create item if it doesnt exist

    Bumping post:

     

    I think I know the steps in theory:

    1. Get Items List A
    2. Get Items List B
    3. Put both into filtered Arrays
    4. Combine Arrays into a single Array based on uniqueID
    5. Loop over combined Array to Update Item in list A
    6. If item in exists in B but not A, create item in list A
    7. Lastly, delete any items from A that are not in B (no UniqueID match)

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492