Hello,
I am hoping for some help on why a SharePoint Flow is running thousands of times - and a way to keep the functionality of the Flow, but stop it running constantly.
I got some help on creating a Flow, here:
https://powerusers.microsoft.com/t5/Building-Flows/Want-to-use-Flow-to-copy-data-from-one-list-colum...
The Flow works great, but it is running thousands of times, as in the analytics when items are not being created or modified:
The reason behind the Flow is as such:
We have a calculated column called “Week Total”
It is desired that “Week Total” be summed, but calculated columns in SharePoint cannot be summed.
We then have a Flow that will run on create or update that takes the value from "Week Total" and puts it into another column called "Sum" that can be summed.
The Flow steps are as follows
Solved! Go to Solution.
Hi @DS1,
Could you please share a bit more about your SharePoint list?
I think there is something wrong with your “Update item” action, the “When an item is created or modified” trigger would be fired whenever an item is created or modified in the list. If you add an item or update existing item in your SharePoint list, the trigger would be fired and then the “Update item” action would update corresponding item in list. After that, the trigger would be fired again, because the “Update item” action has updated one item in SharePoint list. Your flow would be trapped in a infinite loop.
You could consider take a try to stop it running constantly with following workaround:
int(triggerBody()?['Period_x0020_Total'])
Image reference:The flow works successfully as below:
Best regards,
Kris
Hi @DS1,
Could you please share a bit more about your SharePoint list?
I think there is something wrong with your “Update item” action, the “When an item is created or modified” trigger would be fired whenever an item is created or modified in the list. If you add an item or update existing item in your SharePoint list, the trigger would be fired and then the “Update item” action would update corresponding item in list. After that, the trigger would be fired again, because the “Update item” action has updated one item in SharePoint list. Your flow would be trapped in a infinite loop.
You could consider take a try to stop it running constantly with following workaround:
int(triggerBody()?['Period_x0020_Total'])
Image reference:The flow works successfully as below:
Best regards,
Kris
Kris
Thanx for the tip! I guess with your solution the Flow will be executed twice instead of entering an infinite loop, right?
@DS1There are several threads discussing this infinite loop effect like this one
I totally agree it is a limitation in Microsoft Flow. Let's hope Flow architects will find a solution to avoid it in the future. In the meanwhile, workarounds like the one described by @v-xida-msft are needed
Proud to be a Flownaut!
Thank you so much for your help! I've had a chance to try the solution (which so far is workng very well) and will have a look on Tuesday as to the analytics and number of runs.
Really appreciate the support from the community and also to @efialttes
Thanks again, Kris - I've checked this morning and no more looping!
This seems to be somewhat related to my Flow and looping. 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.
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.
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.
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!
User | Count |
---|---|
14 | |
14 | |
8 | |
7 | |
6 |
User | Count |
---|---|
24 | |
17 | |
10 | |
8 | |
7 |