cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Trigger Conditions based on who modified the item in SharePoint last

I am building a flow that will run every time an item is created or modified in a SharePoint list.   I have a service account with permissions to the list and I don't want the Flow to trigger when that account modifies an item.  

(I can do this with a condition but that is not the point, as that causes the flow to run to detect that, I would rather just have a trigger setup where it does not run unless there is a real person modifying the list.)

 

the service account is named "Service:AccountSP" and that is the display name of ti also and the email is ServiceAccountSP@thexxxxxss.org

I have tried the following with no success in adding a trigger conditions:

@not(equals(triggerBody()?['Modified_x0020_By_DisplayName']?['value'],'ServiceAccountSP'))

@not(equals(triggerBody()?['Modified_x0020_By']?['value'],'ServiceAccountSP'))

@not(equals(triggerBody()?['Modified By'']?['value'],'ServiceAccountSP'))

@not(equals(triggerBody()?['Modified By DisplayName']?['value'],'ServiceAccountSP'))

 

Any help would be appreciated as I am new at this and just learning flow. 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Trigger Conditions based on who modified the item in SharePoint last

 

Hi @OscarB ,

 

Please try the following two expressions:

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

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Highlighted
Resolver II
Resolver II

Re: Trigger Conditions based on who modified the item in SharePoint last

@OscarB 

 

Could you please try following?

 

 @not(equals(triggerBody()['Editor']['DisplayName'], 'Service:AccountSP'))   

    *not sure whether your account display name have ':' or not, please check.

 

Following is what I get from response of trigger and Editor is "Modified by"  

 

triggerCondition.png

 

 

Highlighted
Regular Visitor

Re: Trigger Conditions based on who modified the item in SharePoint last

My service account does not have the ":" it is just ServiceAccountSP

 

I get the following error:

he power flow's logic app flow template was invalid. The template condition expression ' @not(equals(triggerBody()['Editor']['DisplayName'],'Service:AccountSP'))' at line '1' and column '2304' is not valid template language expression

 
I tried both with the way you gave to me:

@not(equals(triggerBody()['Editor']['DisplayName'],'Service:AccountSP'))

 

and

 

@not(equals(triggerBody()?['Editor']?['DisplayName'],'Service:AccountSP'))

and got the following error 

The power flow's logic app flow template was invalid. The template condition expression ' @equals(triggerBody()?['Editor']?['DisplayName'],'Service:AccountSP')' at line '1' and column '2304' is not valid template language expression.
 
I get the following when I take the trigger condition out and it the flow runs and succeeds:
Screen Shot 2020-05-15 at 2.00.01 PM.png
Highlighted
Community Support
Community Support

Re: Trigger Conditions based on who modified the item in SharePoint last

 

Hi @OscarB ,

 

Please try the following two expressions:

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

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (8,078)