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 / Add new items to share...
Power Automate
Answered

Add new items to sharepoint list from sql

(0) ShareShare
ReportReport
Posted on by

So I have seen similar posts trying to do what I am describing but I can't quite get it to work.

 

In summary:

1. I have a sql table which contains items that periodically gets added to it.

2. I have a sharepoint list which contains items that I keep sync with the sql table from 1. (That is, I copy items and remove items from the SharePoint list as they appear and disappear from the sql table)

3. I want to get rows from the sql table, get items from sharepoint list, check if an item exist, do nothing. If it doesn't exist, add to the sharepoint list

 

Both lists have keys that are used to make each item unique. This key key_P&LGroup

 

Here is an idea I am pursuing based on the summary

 

Capture.PNG

 

 

For some reason I can't get this to work....What I am doing wrong?

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

    @Anonymous 

     

    I think you can use a filter array action instead of append to array.

     

    fourms sql.JPG

     

    In the value from you can pass the value form SQL GET ROWS this will be our main array.

    Now in the below you can compare it with Value coming from SHARE POINT GET ROWS.

     

    On the LHS side of the condition select Share point and on the RHS side select output that you want to compare from SQL.

    Once you have this value you can pass the Output of this to an APPLY TO EACH loop and you can put just create item action inside that.

     

    It will create an item for all the actions that satisfied the condition.

     

    If this information helps you, please hit the like button and mark the solution as resolved, so that it will help other users in future.

  • Community Power Platform Member Profile Picture
    on at

    Thanks @Krishna92  

     

    I setup something similar to what you propose here and here's what I got 

     

    Capture1.PNG

     

    I can't compare the sharepoint and the sql without running into an apply to each.....So thats 1 and the body at Apply to each 2 contains only the matches of the keys which is, only items that exist in the sharepoint since Apply to Each is bringing items that match on both sides.

     

    What I was hoping to get was items that exist in sql table but not in the sharepoint get added...I used the variable just a test to check how many items would be created if my logic works

     

     

  • Verified answer
    v-alzhan-msft Profile Picture
    on at

    Hi @Anonymous ,

     

    Please refer to screenshot below to create the flow:

    1.png

     

    The expression for the first value in the Condition as below:

    length(body('Filter_array'))

     

    Best regards,

    Alice       

    Community Support Team _ Alice Zhang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • norka14 Profile Picture
    3 on at

    Muchas gracias, de verdad que me ayudo mucho tu respuesta, en mi caso en el filter array coloque el ID de mi SQL = a una columna de mi Sharepoint(esta columna tiene que ser int porque debe tener el mismo tipo de datos del ID de mi SQL)

    mil gracias 😄

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…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 398 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 323 Super User 2025 Season 2

#3
Expiscornovus Profile Picture

Expiscornovus 183 Most Valuable Professional

Last 30 days Overall leaderboard