cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Comparing SQL List to SPO List, then writing Unique SQL items into SPO.

Hello! 

 

   I'm having a bit of an issue comparing what I believe to be 2 different arrays. I'm pulling from a SQL Database 5-10 rows and comparing one columns values to the list of items already in a SPO list. If that column isn't found in the SPO list, then I need to write that SQL Rows data to the SPO list. The item I am comparing (KeyID) is unique and not duplicated anywhere. A couple of questions about this:

 

1. After a lot of trial and error and looking through tons of posts, I think I've found out I need to pass the KeyID column of SQL and SPO into their own array variables then compare them. Is that the best way?

 

2. If it is, I've successfully passed the KeyID Column from SQL to a variable and into Sharepoint. I've had the damnedest time making an IF statement to determine if the KeyID pulled from SQL is already in SPO. My logic is below. I feel like contain is the wrong comparison to use and that I may not be comparing individual elements in the Array Variable to the individual elements in the other Array. Any help is welcome!2019-05-01_13-02-34.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Solution Sage
Solution Sage

Hi @Dave5 ,

It seems you want to check whether the KeyID Column value from SQL in the SharePoint list.

If no, insert the row into the list.

I have made a flow for your scenario, please check it for a reference.

In my flow, I check if the ID value from SQL in the list 'ID' column.

Here I set an array variable to append all the value from the list 'ID' column.

Then use the contains function to check the each item from SQL.

Capture7.PNGCapture9.PNG

Best Regards,

Community Support Team _ Zhongys

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Solution Sage
Solution Sage

Hi @Dave5 ,

It seems you want to check whether the KeyID Column value from SQL in the SharePoint list.

If no, insert the row into the list.

I have made a flow for your scenario, please check it for a reference.

In my flow, I check if the ID value from SQL in the list 'ID' column.

Here I set an array variable to append all the value from the list 'ID' column.

Then use the contains function to check the each item from SQL.

Capture7.PNGCapture9.PNG

Best Regards,

Community Support Team _ Zhongys

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

You're amazing! Thank you. I couldn't wrap my head around this. It works like a charm. 

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (73,124)