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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Insert and Update API ...
Power Automate
Unanswered

Insert and Update API to SharePoint list

(0) ShareShare
ReportReport
Posted on by 26

How do I loop through items in an API and compare the data to a SharePoint list when both have an OrderID as a primary key in common. 

 

Here is the flow so far:

DCDataAnalytics_0-1703113467203.png

I'm not sure how to do the comparison within the Apply to each loop. How do I compare the API item to a SharePoint row, insert a row that does not exist in SharePoint, and update existing rows?

Categories:
I have the same question (0)
  • lbendlin Profile Picture
    8,474 Super User 2025 Season 2 on at

    How large is your SharePoint list?  Might make sense to prefetch the entire list rather than having to query it in each loop iteration.

  • Verified answer
    DCDataAnalytics Profile Picture
    26 on at

    I found the solution:

    • Loop through each item returned by the API using an Apply to each control
    • Use a SharePoint Get Item to check the SharePoint list
    • Use a condition to see if the item was found in SharePoint
      • If yes, update it via a SharePoint Update item
      • If not, insert it via a SharePoint Create item

    DCDataAnalytics_0-1704824088802.png

     

  • DCDataAnalytics Profile Picture
    26 on at

    Less than 10,000 items

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard