Introduction
MS Flow is one of the key Apps on Office 365, which helps in quickly automating tasks and easily building complex business logic on list item level events. With MS Flow adding more actions and triggers, there is almost no need to create Event Receivers anymore. But one significant feature that Event Receivers offered was to disable the event firing when we are updating the same list item with the event receiver.
But MS Flow doesn't provide the provision to stop a trigger.
Problem
Consider the below example where we have a list with 3 columns.

A simple flow can be configured which triggers whenever an item is created or modified, which will update ColumnSum with a sum of ColumnOne and ColumnTwo. The MS Flow steps may look like below.

This Flow keeps triggering itself infinitely, because of the 'Update Item' action.
Solution
As MS Flow doesn't provide any provision to disable the re-trigger, we need to bring in a workaround in our flow structure that stops the Update Item' action, when the update happens from the Flow itself. There are many workarounds but most of them are specific to the logic of the flow and use cases.
Here is a generic workaround that will work for most of the scenarios.
Here is how the high-level flow structure should look like
- Trigger: 'When an item is created or modified'
- Action: Use 'Send an HTTP request to SharePoint' to make a call to the SharePoint REST API to get the last 2 versions of the list item
- We maintain one column called 'FlowFlag' in the list to track if the update event is triggered by the Flow itself or not
- Compare the value of the 'FlowFlag' column from the last 2 versions of the list item
- If the value is the same, then proceed with the Flow, if they are not the same which means Flow has triggered, then terminate the Flow
- And whenever we update the list item, also update the value of the FlowFlag column by incrementing it by 1, so that its value is different compared to the previous version and the next Flow trigger will not update the list item again.







Anan LakPosted Aug 20, 2020, 5:45 AM
Ram it is a good article. But I am wondering where do you update FlowFlag inside the flow?
Shail SPosted Mar 23, 2020, 11:03 AM
Is this solution still working? I still see the flow trigger automatically for previously created items too and keep on creating versions. Please help.
Aakash MauryaPosted Jan 27, 2020, 5:53 PM
I am still wondering how FlowFlag column value is updated from the flow?? following the same articles doesn't resolved problem. Can you please let me know what I m musing??
Ano MepaniPosted Aug 4, 2019, 1:03 PM
Worth to Read this article as well. https://www.techmikael.com/2019/05/gotcha-in-microsoft-flow-when-modifying.html
Raghavendar SwaminathanPosted Aug 4, 2019, 12:16 PM
Thanks Ram for bringing the solution. Kudos
Ano MepaniPosted Aug 4, 2019, 11:09 AM
Very nice example with real world issue which might be occures in developing.