cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ellsworth03054
Helper II
Helper II

Preventing an endless loop

I have a flow that is triggered when a list item is modified.  In that flow, I update a few fields.  How do I prevent those updates from triggering the same flow from running again on the same list item?

1 ACCEPTED SOLUTION

Accepted Solutions
v-bacao-msft
Community Support
Community Support

 

Hi @Ellsworth03054  were the suggestions above able to help you with your issue? Please take a try and feel free to let us know if you have any questions

 

Besides, here is a great article that provides a way to deal with this kind of problem, please check it and see if it helps:

stopping-infinite-loops-when-updating-sharepoint-list-items

 

Best Regards,

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

6 REPLIES 6
PrasadAthalye
Super User
Super User

Refer some techniques given below...

 

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

 

Mark this as an answer if it helps you to solve your issue

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community
Jordon14
Frequent Visitor

Hi,

I would suggest:

  • Creating a 'Choice' type column with a 'No' and a 'Yes' option and call the column 'ModifiedByFlow'.
  • Set the default option of this column to 'No'.
  • After the trigger 'When an item is created or modified' add a condition.
  • The condition should use the newly created column 'ModifiedByFlow' to be equal to 'No.'
  • If this condition is true, update the 'ModifiedByFlow' value to 'Yes' using the 'Update item' action.
  • If this condition is false, select the Termination control and just simply leave the default status of 'Failed'.

This will cause Power Automate to run two flows if the condition is true instead of an infinite loop.  The first flow will be successful (since the default value is 'No') and the second flow will be a failure (since the new value will be 'Yes' when it tries to use the infinite loop).

 

Please mark as solution if this has solved your problem.  Thanks!

 

v-bacao-msft
Community Support
Community Support

 

Hi @Ellsworth03054  were the suggestions above able to help you with your issue? Please take a try and feel free to let us know if you have any questions

 

Besides, here is a great article that provides a way to deal with this kind of problem, please check it and see if it helps:

stopping-infinite-loops-when-updating-sharepoint-list-items

 

Best Regards,

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

Trigger Conditions were my solution here.  Thank you everyone.

y2kardell
Helper III
Helper III

I am working on this form and am having an issue. The way it is supposed to work is, when the user submits a shipping request with name, address, personal or business, shipping method, etc, the 1st approver edits the 1st sharepoint form and inputs the tracking number and cost. Then all the information including the tracking number and cost is created and updated into the second form for the 2nd approver to update with the actual cost before sending an email to the shipper with notification via email of how much will be deducted from their payroll. 

All of that works fine - the problem I am having is the 1st approver is getting 2 approvals for request when all they should receive is just one notification and I cant seem to figure out why? Is there a partial loop issue that is causing this? If so what is the best way to handle it to where the shipper submits their request, it goes to the first approver who edits the forma and updates it with the tracking number and estimated cost, goes to the second approver to updated the second form (after it has been updated with tracking number and actual cost and then alerting the shipper with how much will be deducted from their payroll?

Here is a screenshot of my flow using power automate:

Ship Ticket Request Form.png

 

hemrhk
Responsive Resident
Responsive Resident

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (1,702)