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?
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
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?
@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 firstname.lastname@example.org 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.
Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.
Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.
The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.