cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
m0le
Level: Powered On

My flow falling in to loop

Hi Team

 

This is a simple Sharepoint list add/edit item approval loop
But despite its simplicity, it`s falling to loop and sending itself twice. flow 1.jpgflow 2.jpgSo I receive an approval email when I approve it change the status on SharePoint list from Pending to Approved
But then without a reason, I receive a second email asking for approval for the same item despite that the status on the site is already approved. 
I got only one flow active in my flow list
This is how the SharePoint list approval setting look like 
flow 3.JPG

3 REPLIES 3
Power Automate Staff TravisB
Power Automate Staff

Re: My flow falling in to loop

Hi @m0le,

 

It looks like it's looping because the final action of the flow involves updating the item that triggered the flow (setting the approval status). This action of updating the flow ends up triggering the flow again.

 

Can you discuss your requirements further? Are there any actual edits to the item happening or is approving on the initial create sufficient? If so you can change the trigger to "When an item is created".

 

If you also need approvals on edits, can you enforce that the user manually resets the approval status when they make edits? You can then add a check in the flow to terminate if the approval status is set to approved.

 

If that's difficult to get people to do, you might consider breaking out approvals status into a separate list which you can modify in the flow without re-triggering the flow.

 

Hope this helps!

 

Thanks,

Travis

Super User
Super User

Re: My flow falling in to loop

@m0le:

 

I agree with the comments made by @TravisB but would like to add an alternative.

 

It sounds as though you want the Flow to run only when a new item has been created.  If that is the case, your best bet is to change the trigger as to When an Item is Created as suggested by @TravisB.  That will likely cause you to re-write most of your Flow.  Alternatively, try putting a condition at the top of your Flow immediately after the trigger.  The condition should compare the created and modified columns.  If they are the same, then this is a new item and proceed with the approval.  If they are not the same, then this item has been modified and you should do nothing and exit the Flow.

 

If this addresses your issue, please mark you post as Solved.

 

Scott

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
Administrator
Administrator

Re: My flow falling in to loop

Hello, @m0le!

Thank you for posting on the Flow Community Forum! Have you had an opportunity to apply @ScottShearer‘s recommendation to adapt your Flow? If yes, and you find that solution to be satisfactory, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify!

Thank you for being an active member of the Flow Community!

-Gabriel
Flow Community Manager

-Gabriel
Microsoft Power Automate Community Manager
Are YOU a member of your local Power Automate User Group?
Fill out This Form to claim your Community User Group Member Badge!

Helpful resources

Announcements
firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

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!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (7,752)