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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Check for Duplicate pr...
Power Automate
Unanswered

Check for Duplicate prior to Insert Rows for SQL Server

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I am working on a flow that will help import data into an azure sql database (access web app) from an excel sheet that will be regularly exported to a onedrive folder.

 

I was able to insert the rows from the excel table into the sql table. Now, I am hoping to add some sort of duplicate checker. Currently, I have the sql table set to have a required field "offeringID". I am trying to figure out how to have the flow lookup the row in the excel table to see if offering id already exists in the sql table. If it does not, then it should insert the row. If it does then it should "update" the row. I am struggling with how to get the data from the rows prior to the "for each" insert row step.

 

I see where you can filter data based upon values when getting a row but I must be doing the order incorrectly.

 

Any ideas of an approach to tackle this?

Categories:
I have the same question (0)
  • melim Profile Picture
    Microsoft Employee on at

    Hi Nick,

     

    From your question, it sounds like you have a OneDrive trigger then two action  connectors, one to get the Excel rows and one to get the SQL table.  After your 'Apply to each' connector, you can add  a 'Condition' connector to do a comparison between the new rows in Excel and the existing rows in SQL.  This will give you the option to continue with the operation and insert the rows into SQL or do nothing.

     

    I hope this helps.  Let me know if you have any additional questions.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @melim 

     

    I'm also battling with this and the previous answer is a little vague.

     

    I'm getting two 'arrays' or lists, one from source, one from destination.

    For each item in the source I want to check if it exists in the destination and if not, insert a row.

    I'm using an array output from Planner as the source and Excel as the destination.

     

    The Condition will automatically fall inside the existing "for each", so it cannot check another list as that would nest the for each which is not possible.....so how exactly do you do this?  Can you please provide an example?

     

    Kind regards,


    Russel

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 873

#2
Valantis Profile Picture

Valantis 813

#3
Haque Profile Picture

Haque 526

Last 30 days Overall leaderboard