Recently I was developing a workflow using MS flow for my client. The basic requirement was to update SharePoint list. During development I was surprised because workflow was not stopping when updating a list item. It was getting into infinite loop. Then after lot of investigation I found that whenever updating an item the MS Flow ‘When an item is created or modified’ trigger again and it’s become never ending. Now the question is it possible to stop? Yes.
Let’s discuss the solution in details.
Step 1: Create a list and name it ‘FlowTest’ with column ‘Country’ and ‘First Letter’. Country is a drop-down column with values – Brazil, India, USA.
Step 2 : Now Create a MS flow with same name as list name. The logic of the MS flow is when Country field value is ‘Brazil’ the flow will update ‘First Letter’ field value to ‘B’ otherwise ‘Unknown’.
Step3 : In condition 2 we are checking that if ‘First Letter’ value is not ‘B’ then update the field with value ‘B’. This extra condition to step multiple update of list.
Step4 : In condition 3 we are checking that if ‘First Letter’ value is ‘B’ then update the field with value ‘Unknown’.
If you follow this steps the workflow will run twice but not infinite times.
If any question please comment or drop me a mail at email@example.com