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

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
TravisB
Power Automate
Power Automate

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

ScottShearer
Super User III
Super User III

@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
GabrielStJohn
Microsoft
Microsoft

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
Community Manager
Power Automate | Power Virtual Agents
Super User Program Manager



Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,336)