cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Vstar19
Helper IV
Helper IV

Flow to update SharePoint List from SQL Server.

Hello, 

I have a SharePoint list, as below

 

ID      | Item     | Description 

1234 | Item A | Description of Item a

5678 | Item B | Description of Item B

9101 | Item C | Description of Item C

 

I also have a SQL Table as below. The SQL Table is updated on a regular basis with the latest information. 

ID      | Item                   | Description                                      | Business Unit

1234 | ITEM A. XYZ       | Item A Description. Loreuim Ipsum | BU A

5678  | Item B               | Item B Description                           | BU A

9101 | Item C : Update | Item C Description                           | BU A

3741 | Item D               |                                                           |BU C

4354 | Item E                | Item E                                               | BU C

5632 | Item F                |                                                          | BU A

 

What i need to do is loop through the sharepoint list and update the Name and Description. 

I created a flow which gets all the SharePoint Items (There are approx 400)

I also, using the Get Rows SQL Action got all the records from SQL where BU = BU A. There are approx 400. 

 

i tried to do a condition to say 

 

If SharePoint ID = SQL ID and SharePoint Name does not equal SQL or SharePoint Description does not equal SQL Description, then update SharePoint list item with the new name and description. 

 

Firstly, the flow takes forever to run (it times out, but still continues to run) - i presume because of the multiple conditions. 

Secondly, i dont think my approach is the best way to solve this. I dont even know it works as even though the flow succeeds, there are 400 items for me to look through to check if the condition was met. 

 

Can anyone shed any light on how i can achieve my results of updating the SharePoint list with the latest Name and Description from SQL.  

 

Thank You

3 REPLIES 3
eric-cheng
Solution Sage
Solution Sage

Hi @Vstar19 ,

 

I am assuming based on your description, you are using a scheduled flow.

 

Would it be possible to create a cloud flow with a SharePoint trigger that is triggered when an item is created/updated in SharePoint?  That way, you will always run the flow when items are created (data kept in sync) and you don't have to worry about big loops and duration.

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

Hi.

That is an excellent recommendation.

I will look into this and see if it works for me. 

 

On the SharePoint list I have included additional fields like 'Have you signed the terms for this item' which the user must agree via a choice column.. this choice column can change multiple times.

I am assuming I can limit the flow to not run when the 'Have terms been signed', as this column will be updated regularly. 

 

Thanks

 

 

 

 

Hi @Vstar19 ,

 

Yes, you can add a trigger condition by going to settings of your trigger.  This will allow you to add an expression with that field.  

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,534)