cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Update multiple SharePoint Items

There seems to be looping issues with my Flow.  My source data is in SQL on-prem and I'm wanting to pull all rows from SQL in to a SharePoint Online list.  I'm able to run the initial SharePoint create items action which successfully creates the items in SharePoint i'm expecting.  In my condition below, the ProjectNumber array is checking for project numbers that have been created in my SP Online list then storing those in the array.

 

CreateItems.png

 

Each month, I will also need to update existing items in my SP Online list, as there are certain fields that will change from month-to-month.  Within the same condition, if ProjectNumber in SPO matches what's in SQL, I will run an update item and only update certain fields that are expected to change month-to-month.

 

UpdateItem.png

 

As to my data, I am expecting to loop through around 1000 rows of SQL data each month then update items in my SPO list that change in SQL.  For testing, I am applying a filter so I only get 6 rows of data back.  Here's what my data looks like:

 

Rows 1-6:

ProjectNumber, Project Name, AccountingDirector, ProjectAccountaint, ActiveStatus, CurrentPeriodBillings, PercentComplete

 

All of this data is mostly unique, such as ProjectNumber, ProjectName and a few other fields

 

When I run my Flow, I get all items in the SPO list and get all items in my SQL view

I have a condition that checks if my SPO project number contains my SQL project number

If No, create item (which works great)

if Yes, update all fields in my update items screen shot

 

The problem is when the Flow runs, all projects get updated with the same data 6 times

For example:

If I have Project 1234 and all of its corresponding data for my 1st project

Project 2345 and all of its corresponding data for my 2nd project

Project 3456 and all of its corresponding data for my 3rd project

Project 4567 and all of its corresponding data for my 4th project

Project 5678 and all of its corresponding data for my 5th project

Project 6789 and all of its corresponding data for my 6th project

 

When my Flow runs, all 6 items get updated with Project 1's data the first time around.  Flow repeats this loop process all 6 times and I can see on the 2nd loop that all 6 items get updated with project 2's data, etc.  This continues until the looping completes with the number of rows that are expected to be looped through.  In the end, all 6 items finally get updated with project 6's data then the Flow completes.

 

What I want is for only project 1 to get updated with its data, project 2 with its data and so forth.

 

Is this a bug within Flow, expected behavior or just a logic issue with my Flow.  Everything I've read seems to indicate the update item portion should work as what's in my screen shot.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Update multiple SharePoint Items

Hi @kurt3000,

 

Could you share a full screenshot of you flow?

I have made the following test, the flow will check the existing items first, then update the existing items or create items based on situation.

Please check the following image for a reference.

 1.PNG2.PNG

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
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

1 REPLY 1
Highlighted
Community Support
Community Support

Re: Update multiple SharePoint Items

Hi @kurt3000,

 

Could you share a full screenshot of you flow?

I have made the following test, the flow will check the existing items first, then update the existing items or create items based on situation.

Please check the following image for a reference.

 1.PNG2.PNG

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
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

Helpful resources

Announcements
firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (7,650)