cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate I
Advocate I

Email trigger flow stuck in infinite loop?

I'm having a weird issue that I haven't quite seen described here...

 

I have a Flow that triggers on "When an item is created or modified"

The flow then updates a field on the same item.

When I first create this flow, It worked great.  I could create an item or modify it, the flow would trigger, change the item and all was good.

Now we are finding that if we create or edit an item, the flow runs every minute for days.

I can stop the flow, start it again and all is good until we create/edit a new item.

It looks as though the flow doesn't recognize that it was the process that last modified the item so it just keeps going.

This is what it looks like:Flow-BranchModify.pngAny ideas?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Email trigger flow stuck in infinite loop?

Hi @sperley,

 

The flow with trigger "When an item is created or modified" would always be triggered when the item is created or updated from the sharepoint list or by flow.

 

As the alternative solution in the lionk below:

https://powerusers.microsoft.com/t5/General-Flow-Discussion/run-flow-when-item-modified-not-from-the...

 

If you would like to run a flow only when an item is modified from the sharepoint list, and don't want to run a flow when an item is modified from the flow, as an alternative way,you could consider:

1.add a "Yes/No" type column "ModifiedByFlow" in the sharepoint list, and set the defaults value of "ModifiedByFlow" column to No.

2.when modify an item from the sharepoint,keep the "ModifiedByFlow" column to No.

3.every time modify the item from flow use the Update item action, set the "ModifiedByFlow" column to Yes.

4.add a condition under the trigger "When an item is created or modified" to check if the item is modified from sharepoint or from flow, if the item is modified from flow, do nothing.if the item is modified from sharepoint, do something you want .

 

Best regards,

Alice

View solution in original post

5 REPLIES 5
Highlighted
Community Support
Community Support

Re: Email trigger flow stuck in infinite loop?

Hi @sperley,

 

The flow with trigger "When an item is created or modified" would always be triggered when the item is created or updated from the sharepoint list or by flow.

 

As the alternative solution in the lionk below:

https://powerusers.microsoft.com/t5/General-Flow-Discussion/run-flow-when-item-modified-not-from-the...

 

If you would like to run a flow only when an item is modified from the sharepoint list, and don't want to run a flow when an item is modified from the flow, as an alternative way,you could consider:

1.add a "Yes/No" type column "ModifiedByFlow" in the sharepoint list, and set the defaults value of "ModifiedByFlow" column to No.

2.when modify an item from the sharepoint,keep the "ModifiedByFlow" column to No.

3.every time modify the item from flow use the Update item action, set the "ModifiedByFlow" column to Yes.

4.add a condition under the trigger "When an item is created or modified" to check if the item is modified from sharepoint or from flow, if the item is modified from flow, do nothing.if the item is modified from sharepoint, do something you want .

 

Best regards,

Alice

View solution in original post

Highlighted
Advocate I
Advocate I

Re: Email trigger flow stuck in infinite loop?

Thanks Alice (@v-yuazh-msft),

 

That does workaround the issue for me and I was able to add it to my list and Flow fairly easily.

 

Being used to SharePoint and Salesforce workflows, I've never had to build that qualification in...  Is this something that is being looked at for future releases?  

Highlighted
Frequent Visitor

Re: Email trigger flow stuck in infinite loop?

Just a note that this will not work. The only way you can update the "Modified by MS Flow" field back to "No" is by doing an update which defeats the purpose. 

I would recommend using a single previous field called "Previous Fields" which is a concatenation of fields you want to change. Then compare this in your condition with the current values. Then update the "Previous Fields" field with the new concatenated values.

Highlighted
Continued Contributor
Continued Contributor

Re: Email trigger flow stuck in infinite loop?

It depends on how that field is being updated. If it's a form customized with powerapps or infopath, the form could flip that field, which would result in the workflow running correctly. But yes, you're right that this is complicated, more than it should be.

Highlighted
Frequent Visitor

Re: Email trigger flow stuck in infinite loop?

@v-yuazh-msft 

Alice,

 

I'm attempting to do as you suggested but am having trouble with Step 4: 

4.add a condition under the trigger "When an item is created or modified" to check if the item is modified from sharepoint or from flow, if the item is modified from flow, do nothing.if the item is modified from sharepoint, do something you want .

 

What does this look like?  Would you attach an image with an example?

 

Also, does the SP column need to be added to all content types or just to the specific library I want to check it?  Currently I created it just in the library I am checking for the trigger: When a file is created in a folder. 

 

Thanks

 

Andee

Helpful resources

Announcements
FirstImage

Microsoft Ignite 2020

Check out the announcement of Power Platform content at Microsoft Ignite!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (7,292)