Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Suggested answer

How to check which records are missing in SQL

(0) ShareShare
ReportReport
Posted on by 2
Hello, 
I have such a flow and I would like to check what records are missing in SQL in relation to SharePoint. Two databases have the same ID. I am a bit confused and I am asking for help:
  • CU30091316-0 Profile Picture
    2 on at
    How to check which records are missing in SQL
    I tried to use Filter Array but I get the wrong result. This is my code.
     
    What I mean is that when I have 25 in SQL I would like to find those 4 more that are in Sharepoint 
     
    @not(contains(outputs('Get_rows_(V2)')?['body/value'], item()))
  • Suggested answer
    SaiRT14 Profile Picture
    1,988 Super User 2025 Season 1 on at
    How to check which records are missing in SQL
    • Loop through SharePoint IDs:

      • Use an Apply to Each loop on the SharePoint IDs array.
      • Inside the loop, use a Condition action to check if the current SharePoint ID exists in the SQL array.
    • Check for Missing Records:

      • If the ID does not exist in the SQL array, you can mark it as missing by appending it to a separate array (e.g., a "Missing IDs" array).
    • Create Output:

      • Once the loop completes, output the "Missing IDs" array to either a SharePoint list, SQL table, or send it via email using the Send an email action.
  • David_MA Profile Picture
    11,500 Super User 2025 Season 1 on at
    How to check which records are missing in SQL
    It has been quite a while since I have done something like that, but I think what you need is in this blog post: Efficient Union, Except And Intersect – Great Method - DamoBird365. I don't know if this is the same resource I used, so I cannot guarantee it will meet your needs. But I am pretty sure you can do it with something like this.

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