web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Automate
Answered

Infinite Loop in Flow

(0) ShareShare
ReportReport
Posted on by 353

Hi guys.

 

I collect the data useing PowerApps and store it in the Sharepoint. Then, I created a flow that started with "when item is created or modified" (from SharePoint).

 

The flow will run certain functions, but in the end, it will update the item in the sharepoint and send a message to the one that fill in the form.

 

The problem that I have been facing is that as the flow has "Update Item" function at the end of the flow. it means that it will modify the items again, even though it has been modified. This will caused the infinite loop to happens.

 

I could not figure out on how to stop the flow. I hope anyone ca helps. Thansk

Categories:
I have the same question (0)
  • Verified answer
    Jay-Encodian Profile Picture
    2,920 on at

    Update  - The post below was pre trigger conditions, you should now use trigger conditions for this requirement - https://powerusers.microsoft.com/t5/Power-Automate-Community-Blog/Power-Automate-Trigger-Conditions-made-EASY/ba-p/441348

    ***********************

    Hey @_kikilalaaa 

    I created a blog post covering this topic earlier this year, check out - https://powerusers.microsoft.com/t5/Power-Automate-Community-Blog/SharePoint-Managing-Recursive-Events-in-Flow/ba-p/250076

    This approach uses a service e account to do the update via Flow, thus you can add a check to validate which account performed the update and not do anything when the service account made the change breaking the loop.

    Now, if you’re update via the Flow was consistent... i.e. you changed a column value to ‘changed by power automate’ then you could use that in your condition check... that said the service account approach is the most robust way to do it.

    HTH

    Jay

  • Verified answer
    RobElliott Profile Picture
    10,420 Super User 2026 Season 1 on at

    There is an alternative in case you don't want to or can't use a service account and that is to use a trigger condition. You would add a text column to your SharePoint list called for example Updated with a default value of No. In the update item action you would set the column to Yes. Then in the settings of the When an item is created or modified you would add a trigger condition of @equals(triggerBody()?.Updated, 'No') so the trigger will only fire if the Updated column is equal to No. One advantage of this method is that if you do want to send the email to the item's creator for a specific item then you just set the Updated column to No when you are modifying it.

    Rob
    Los Gallardos
    If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

     

  • Jay-Encodian Profile Picture
    2,920 on at

    Good shout @RobElliott 

    We've experimented with similar approaches before but it's not robust where you have more than a single update or 'unreliable users'... i.e. the trigger condition isn't reset or updated correctly, agree?

  • RobElliott Profile Picture
    10,420 Super User 2026 Season 1 on at

    @Jay-Encodian I've not had issues with using trigger conditions (other than usually forgetting what the correct syntax is!), but unreliable users? Ah now that's a problem I don't think even Power Automate can fix just yet 🙂

    Rob
    Los Gallardos

  • Jay-Encodian Profile Picture
    2,920 on at

    @RobElliott 

    We've not had issues with the triggers either, just users who forget to set data correctly to enable the Flow to execute properly... new feature required 😂

  • _kikilalaaa Profile Picture
    353 on at

    set a condition.PNG

     Hi @RobElliott & @Jay-Encodian !

     

    Thanks for your help. It gives me some idea to solve the problem. Here's my updated flow.

    I have a column called form status in PowerApps Form, and I have set the default as "draft". The flow will only run if the form status is "draft".

     

    However, if the approver have reject the application, the user can edit back the form and set the form status as "draft". Here, I got the problems. Sometimes the flow failed and it says that it have some errors in the server. I think it is because of the form status changed just now. Do you guys have any opinion about this?

     

    Thanks! 

  • RobElliott Profile Picture
    10,420 Super User 2026 Season 1 on at

    @_kikilalaaa put in a delay of, for example, 30 seconds before the condition so that the list item has time to be updated back to Draft before the condition and the following actions are done. That might solve it.

    Rob
    Los Gallardos
    If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

  • _kikilalaaa Profile Picture
    353 on at

    Hi @RobElliott ,

     

    I have figured out that the problems come from Power Apps. The error shown is "run time" error, ETAG mismatch.

    I think this happened because of the condition(approve/reject) just now. I will try to ask in Power Apps community about this. 

     

    Thank you!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @RobElliott ,

     

    Thanks for the tip.  It got me looking for a bit more detail and I came across this discussion.

     

    https://powerusers.microsoft.com/t5/General-Power-Automate/Trigger-conditions-for-Flow-now-available/m-p/334463/highlight/false#M39694

     

    Reza has a very good video on how to get the precise syntax for the different field types you may want to use as trigger conditions.  Just another piece of good information to pass on to those who might need it.  I really helped me!

     

    Dave

  • ScottShearer Profile Picture
    25,290 Most Valuable Professional on at

    @Anonymous 

    I wrote a blog post on another approach that relies on versioning and is very easy to implement.

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 304

#2
David_MA Profile Picture

David_MA 245 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 243 Most Valuable Professional

Last 30 days Overall leaderboard