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

GDS_User01 41 Reputation points
2021-01-07T11:26:54.613+00:00

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.

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,830 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
3,044 questions
SharePoint Workflow
SharePoint Workflow
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Workflow: An orchestrated and repeatable pattern of business activity, enabling data transformation, service provision, and information retrieval.
602 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,619 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Emily Du-MSFT 47,301 Reputation points Microsoft Vendor
    2021-01-08T08:51:08.35+00:00

    @GDS_User01

    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.

    0 comments No comments

  2. GDS_User01 41 Reputation points
    2021-01-08T13:51:45.88+00:00

    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.