My Flow is sequential approval where it has two approvers.
The problem is after the first flow ran successfully, it keeps starting running again by itself.
If I guess it is correct, the library set in the trigger and Update file properties action is the same, so when the Flow executes the Update file properties action, it creates the conditions that match the Flow trigger.
Because the condition contained in the trigger is that when the file modified, Flow will also trigger, so it is caught in a loop.
Yes, you are correct. I just received a call from Microsoft support professional, they said the same as you said. Unfortunately, they could not find the solution. They just said that I must not have trigger "When a file is created or modified (properties only)", instead I can only have a trigger "When a file is created (properties only)".
In fact, I agree with them that if you are targeting only newly created items, you could use When a file is created(properties only) as the trigger.
I have same scenario for my flows when i update item from flow the flow trigger again as said by @v-bacao-msft , I create a flag column in sharepoint, and trigger flow only flag true
so if you want to not trigger flow again on update you just set Flag Value Yes on update item action
so in this way you flow runs but not inner action if condition is false.
Hopefully this answer will help you.
Sorry I am still confused. From your explanation my understanding is when a user creates a file then set the value of Form Value to Yes, in order to stop inner loop. However, when the user edits the file then the Flow will not go to Update item action and also other actions in the Flow?
@Harry_G. I am making the flow for Purchase Order Request. So the workflow is as follows, a user creates a form (Purchase Order Request) and submits it to Purchasing manager for approval. When Purchasing Manager rejects and gives some comments to make correction on the form, then the user will edit the form, and then resubmit the form. This condition may take place several times.
@deddyandy ok. so I think you have to use some status and flag value.
create a column Status
add condition @equals(triggerBody()?['Status'], 'FormSubmitted') and if you have use powerapps than you assign defult value of status == "FormSubmitted", So when the edit the form and resubmit it status value automatically change to FormSubmitted
when you update the item from flow just change the status and assign some other value. flow only runs when status is FormSubmitted i will attached demo flow so you can understand better.
@Harry_G OK, so when a file is created the value of Form Value is "No", then when in Update item action, it is set to "Yes", then it will not loop back. Next, when the file is edited, you said that the value is automatically set to "No"? Is it possible? How do you do that?
@deddyandy in my scenario i have item list not a document library. So I create a form in power apps and set default value of flag when item is edited from form.
@Harry_G Sorry it has taken your time. I have not learned power apps. I geuss I just have to accept using only when a file is created action.
Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!
Many congratulations to the Season 1 2021 Flownaut Crew!
Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.
Check out the community blog page where you can find valuable learning material from community and product team members!