cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tism
Kudo Collector
Kudo Collector

BUG: Infinite Loop when updating a SharePoint list item

When you have a trigger in Flow on a SharePoint list item/file, and the Flow then updates the same item/file, the update causes the Flow to kick off again.  We need a way for the Flow to only run once, regardless of which field was updated, without the need for any ridiculous work arounds.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @tism ,

 

Hope the link below could help you:

https://powerusers.microsoft.com/t5/General-Power-Automate/Update-Item-Infinite-Loop/m-p/252742

 

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.

View solution in original post

5 REPLIES 5
v-alzhan-msft
Community Support
Community Support

Hi @tism ,

 

The issue that you mentioned isn't a bug and you must be using the "When an item is created or modified" trigger of sharepoint connector in your flow, the "When an item is created or modified" trigger would run whenever an item is created or an item is modified in the sharepoint list.

If you want the flow would only run when an item is created in the list, you should add the trigger "When an item is created" of sharepoint connector in your flow.

 

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.

 

You've made the assumption that I only want to update a list item when it is created.  The assumption is incorrect.

 

I want to update the item when the item is EITHER created or updated, and then, subsequently, have the Flow NOT run another instance of the same Flow, which causes another instance of the same Flow to run, which causes another instance of the same Flow to run... etc.

The infinite looping issue is a bug, because you have to apply workarounds to fix it. 

v-alzhan-msft
Community Support
Community Support

Hi @tism ,

 

I understand your issue, so you want your flow would update the item when an item is created or modified.

If you add an "Update item" action under the trigger, the flow would run into endless loop, the flow would run again since it don't know if the item is modified by manually in the sharepoint or by the flow.

 

This is known issue and there is an alternative solution for this issue currently, that is add a Condition under the trigger to check if the item is modified by manually or by the flow.

You could refer to steps below:

1.Add a Yes/No type column "UpdatedByFlow" in the sharepoint list, set the default value of the column to false. whenever you add an item to the list, set the column of this item to false, and whenever you update an item in the list, set the column of this item to false.

2. Create a flow with trigger "When an item is created or modified", add a Condition under the trigger to check if the "UpdatedByFlow" column value is equal to false, and if the column is equal to false, you could add the "Update item" action inside the If yes branch of the condition,set the "UpdatedByFlow" field to Yes, and leave the If no branch of the Condition blank.

3.So every time when you create an item in the list, the flow would run into the if yes branch of the condition and uodate the item.

When you update an item in the list, the flow would run to update the item and set the UpdatedByFlow column to Yes, and flow would be triggered again,but it would run into the If no branch and wouldn't update the item again.

 

Hope it could help you.

 

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.

 

@v-alzhan-msft I appreciate what you've suggested, unfortunately this is not a viable solution.

 

With potentially hundreds of users that the solution we're trying to build is for, getting them to set the "UpdatedByFlow" field every time they make a subsequent edit on a list item is simply not a realistic expectation of them.  We want things to be simple for them, and having to burden business users with a workaround because of a Microsoft issue is simply not going to be acceptable to managers.

So I'll re-iterate what I said before - this issue requires very clunky workarounds to mitigate it, so it is a bug - or a design defect - or whatever you want to call it, in the real business world this is a painful issue, and needs to be addressed.

Hi @tism ,

 

Hope the link below could help you:

https://powerusers.microsoft.com/t5/General-Power-Automate/Update-Item-Infinite-Loop/m-p/252742

 

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.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,433)