cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AMH101
Frequent Visitor

Adding a "@mention" in SP list item comments triggers "When an item is created or modified" flow

I have a multi-stage approval flow that is triggered "When an item is created or modified" and all was working fine until I added a "@mention" comment to the SP list item. This then caused the flow to trigger again which I don't want it to. 

 

Does anyone know a way to prevent this from happening or is this just an unintended consequence with the release of this new feature?

3 REPLIES 3
Pstork1
Dual Super User
Dual Super User

This is a relatively common issue when updating a SharePoint list in the middle of an approval.  The fix is normally to add some kind of trigger condition on the trigger to keep this update from re-triggering the flow.  One easy way to do this is to create the flow using a service account and then add a trigger condition that keeps the flow from triggering if that account modifies an item.  Try the following for a trigger condition

@not(equals(triggerBody()?['Editor']?['DisplayName'], 'ServiceAccountName'))


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Thank you! That makes it clearer!

 

Now I'm having the issue though that I only want the flow to be triggered by the service account. The reason being that in the approvals, other users will edit the info but the service account will never touch it, now I need it to be triggered by the service account adding a new item to the list (from a different flow) but never from one of my organisation's users so that we can avoid the infinite trigger loop. How would I write that trigger condition?

 

I've tried: 

@OR(equals(triggerOutputs()?['body/Editor/Email'],'Service Account Email login'),equals(triggerOutputs()?['body/Editor/Email'],'Service Account Email display'))

@equals(triggerOutputs()?['body/Editor/Email'],'Service Account Email login')

@equals(triggerOutputs()?['body/Editor/Email'],'Service Account Email display')

 

The two email variations are due to my organisation having a login email address and one that is forename.surname@organisation.com linked to each account.

It would be essentially the same code, just remove the @not().  Also its good enough to use either the email or display name as long as its unique.  You won't need both.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (5,303)