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

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Check if id matches in...
Power Automate
Unanswered

Check if id matches in sharepoint list when pulling rows from SQL Server.

(0) ShareShare
ReportReport
Posted on by

Hi Guys, 

 

I am trying to run a flow that pulls rows from a sql server table, checks if the row is already added to a sharepoint list, and updates the row if it already exists, and creates the row if it doesn't exist, Here is what I have tried:

scrosb_1-1620349057287.png

 

 

In this case the title in Sharepoint is populated with the ID. What do I need to put into the condition box in order for the flow to run correctly? is there a better way to do this?

Categories:
I have the same question (0)
  • Verified answer
    Mira Ghaly Profile Picture
    11,413 Moderator on at
    Re: Check if id matches in sharepoint list when pulling rows from SQL Server.

    @Anonymous 

    I suggest another better approach as below:

    On the GetItems you add a filter Query:

    Mira_Ghaly_0-1620361223882.png

    This will return records only in case the Title of the sharepoint list exists with the SQL ID

    Then you check the length of returned records if greater than 0, then records exists and you need to Update ; otherwise create

    Mira_Ghaly_1-1620362139500.png

    Expressions for 1& 2:

    length(outputs('Get_items')?['body/value'])
    outputs('Get_items')?['body/value'][0]['ID']
    
  • Community Power Platform Member Profile Picture
    on at
    Re: Check if id matches in sharepoint list when pulling rows from SQL Server.

    Thank you so much, this worked perfectly. 

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 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard