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

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / "When an item or a fil...
Power Automate
Unanswered

"When an item or a file is modified" and Approvals = infinite loop?

(1) ShareShare
ReportReport
Posted on by

Up until September 2023 we had a nice set-up on a small Document Library that was working flawlessly.

 

We had one flow (A) that triggered Approvals "When a file is created (properties only)" and one flow (B) that triggered an Approval "When an item or a file is modified".

 

We had a problem with B recently where the Approval was created with notifications disabled (no idea how this happened). I fixed this today and, in testing, noticed new behaviour. When Flow A is completed (i.e. the Approval Status is set to Approved), it appears to immediately trigger B - presumably because the Approval Status change is considered a modification. While I would like to avoid this happening, my real concern is that this is actually going create an infinite loop, whereby Approvals keeps modifying the file and triggering flow B.

 

Is this possible? Can it be avoided?

Categories:
I have the same question (0)
  • hpatel95 Profile Picture
    47 on at
    Re: "When an item or a file is modified" and Approvals = infinite loop?

    Hello folks,

     

    I have similar issue,

    I have two separate flows for same SharePoint list.

    Each flow is "when item modified in specific column, only the flow trigger and send an email."

     

    now when I want to send 1st email, I change item in one choice column and the flow triggers.

     

    But as the same time, my 2nd flow also triggers and failed. (dose it means my API is counted in that failed flow?)

    and the 2nd flow is not sending the email because in 2nd choice column the values is not there. (means it's actually working)

     

    My question, how I can trigger only one time when item is modified?

    As we know we have limited API request per day Requests limits and allocations - Power Platform | Microsoft Learn.

     

    I have license so I am assuming I have 40000 limits. (which is more than enough but when there will be many entries (5000) then I will have problem for this API right?

     

    hpatel95_0-1718177544435.png

     

    When in SharePoint list, there will be many entries, I am afraid my limits per day will be finished because triggering both flows.

    Or maybe I do not understand how this limits works.

    Please someone help me.

    I do not have access to see how many flows cycle I used in a day. So, I cannot really, see?

    Kindly help.

  • Verified answer
    PT-10121033-0 Profile Picture
    on at
    Re: "When an item or a file is modified" and Approvals = infinite loop?

    You are using a different Trigger to me so it's not quite the same problem.

     

    In your case, you have two flows with the same Trigger. You may be able to cancel the 2nd Flow using a Trigger condition (see below). However, could you not use a different Trigger (maybe "When an item or a file is modified"), and combine the two Flows into a single Flow, and use a Condition in your Flow to check each column? May be that would actually trigger more runs and API calls, though?

    Trigger conditions partially fixed my problem. Our Flows are run by a dedicated user account ("Flows User") that is not used for business as usual. I simply had to check if this user had caused the file modification that triggered the Flow. If it did, then I know it was just another Flow modifying the file.

     

    Screenshot 2024-06-12 095100.png

    Finding the correct syntax for the Trigger Condition is a bit difficult - note the not() at the begining of mine, I don't want it to run for this Editor.

     

    Screenshot 2024-06-12 095601.png

    You can find the triggerOutputs in a previous Flow run:
    Screenshot 2024-06-12 100205.png

    The second thing I did was use a Condition in the Flow to check the "Content Approval Status" (unhelpfully called "Moderation Status" in the triggerOutputs). This is the column that is updated by Approvals. If the "Content Approval Status" is already "Approved", the Flow is Cancelled.

    Screenshot 2024-06-12 101043.png(Note we also check the item is not a folder - we don't care about those changing.

    Hope that helps someone!

     

     

  • hpatel95 Profile Picture
    47 on at
    Re: "When an item or a file is modified" and Approvals = infinite loop?

    Hmm,

    Yes mine is little different!

     

    But thank you.

     

    I have my team group email. Which I currently do not have access to use. I requested it.

     

    but If I will have then I can use this to send emails on behalf of my group email.

    hpatel95_0-1718188211950.png

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard