question

GDSUser01-2876 avatar image
0 Votes"
GDSUser01-2876 asked EmilyDu-MSFT edited

Flow Trigger Condition: User<>"..."

NEED: A trigger condition to prevent a specific user from triggering a trigger.

It is something like the following, but can't seem to format it correctly to get the Expression Builder / Flow Checker to accept it.

          @not(@contains(triggerOutputs()?['body/Editor/DisplayName'], ‘Bobby McGee’))

(In case this matters: In the Trigger Settings the Array is: @triggerOutputs()?['body/value'] )

Please properly format this expression such that it will be accepted by the expression builder. (It doesn't matter if it's the username, email, or anything other user metadata. Whatever will work to suppress this user from triggering the trigger.)

Thanks.

office-sharepoint-onlineoffice-sharepoint-server-developmentsharepoint-devsharepoint-workflow
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

EmilyDu-MSFT avatar image
0 Votes"
EmilyDu-MSFT answered EmilyDu-MSFT edited

@GDSUser01-2876

Please try below expression in the trigger condition.

 @not(equals(triggerOutputs()?['body/Modified_x0020_By/Email'], 'user account@tenant.onmicrosoft.com'))


If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.





5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

GDSUser01-2876 avatar image
0 Votes"
GDSUser01-2876 answered EmilyDu-MSFT edited

I couldn't get that to work, but gave me a headstart.

I was able to select one of the green boxes that represents: triggerOutputs()?['body/Editor/Email'] (from the "When an item is Created or Modified" Section, usually the last section at the bottom of the dialog box from the Dynamic Content / Expression builder window.)

Using it, I could verify that it, not only, had a value, but what that exact value is.

(I made a log list to create my own "Workflow History" list, like SPD used to do.)

With that, I used this instead:

  **@not(equals(triggerOutputs()?['body/Editor/Email'], 'Username@domain.com'))**

For even more posterity:
I have experienced a situation where Flows DO NOT trigger, at all. Using a Trigger Condition like this leaves no trace that the Flow was even attempted to run. I was hoping that the Run History for the Flow would at least acknowledge that an attempt was made, but it does not. Unfortunately, this causes ambiguity as to whether the trigger failed to trigger, or if the trigger was suppressed by the Trigger Condition. With that, I'm more inclined to trap for the condition within the workflow, and report it through my log list.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@GDSUser01-2876

I test in my SharePoint Online. When the trigger is set to "When an item is Created or Modified", after the item is modified, the flow will run and Modified By filed will be the flow connection owner. So the trigger condition does not work.

For further assistance, you could go to Microsoft Power Automate Community.


If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 Votes 0 ·