cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Danna
Helper I
Helper I

Trigger Condition (send and e mail when a list is modified by specific user)

Hello,

Happy new year!

 

I create a flow to "send an email when an item is created or modified", the thing is required the flow to run only when a specific status field is changed to "send" and I need the flow to run only if the change is made by a specific user (flow owner), that's because many people have access to this List, and want to avoid to fire the flow by other users who edit information on list by mistake.

 

1. When an item is created or modified

2. Send an email

    Trigger Conditions:

    1rst: When a status field is modified to "Send" (which actually runs correctly)

     2nd: When the modification was made for a specific people (not all Share Point users). I found from dynamic content "Modified by email" so I got the following Trigger Conditions:

@equals(triggerOutputs()?['body/Editor/Email'], 'danna.yenisei.morales.delgado@bd.com')

Query Trigger Condition with specific email 2.png

Query Trigger Condition with specific email.png

Query Trigger Condition with specific email 3.png

its important to mention that the condition formula was obtained by using "Filter Array" and by clicking in "Edit in advanced mode"

The second Trigger condition is giving me trouble, I give the screen for the flow asking for your help

 

I really appreciate your help as soon as possible

 

The dynamic content options are the following:

Query Trigger Condition with specific email 4.png

7 REPLIES 7
abm
Super User
Super User

Hi @Danna 

 

The expression looks ok to me. To debug try to remove the first condition and see whether that works. Also check the email returning from flow are all in same case (Captial or Small). Make sure there are no spaces in between the conditions.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Hi @abm  thank you for the soon response,

I tried only with the 2nd condition to see if works, but unfortunately it doesn't work.... 

Then I tried something different, the following condition and get the same result ...the flow doesn't run:

When: Modified display name - is equal to - Created by display name

@equals(triggerOutputs()?['body/Editor/DisplayName'], triggerOutputs()?['body/Author/DisplayName'])

Query Trigger Condition with specific email 5.png

 

Finally I tried other:

Modifed by Display Name - is equal to - Name

@equals(triggerOutputs()?['body/Editor/DisplayName'], 'Name')

And the flow run 😀..I will make more testes tomorrow to be sure the flow fire only with my user name and confirm you if it was solved 

 

Regards,

Hi @Danna 

 

Thanks for your reply.

 

Also try using the AND operator as in one expression.

 

@and(equals(triggerOutputs()?['body/Editor/Email'], 'test@test.com'),equals(triggerOutputs()?['body/GlobalHoldStatus/Value'],'Send'))



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

@abm,

Sorry the delay response, I was making tests.

Thank you very much for the support and the last formula, was very useful.

 

I just have only one doubt, hoping you could help me:

 

- Regarding the formula suggested which works very well, is it possible to have 2 emails, in this case, how could be re-configured the formula? I mean set a condition to the flow to run only when (specific two people made the change and status change to "Send")

@and(equals(triggerOutputs()?['body/Editor/Email'], 'test@test.com'),equals(triggerOutputs()?['body/GlobalHoldStatus/Value'],'Send'))

 

Regards,

Danna

Hi @Danna 

 

You may need to apply the OR condition here. 

 

@and(@or(equals(x,x),equals(y,y)),equals())

 

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Thank you @abm,

Yesterday tried to set the new condition, but doesn´t work, I review the parenthesis but I cannot find the mistake, the Flow checker does not let me save with the new condition. I write here detailed, hoping yo u could find the solution:

 

@and(@or(equals(triggerOutputs()?['body/Editor/DisplayName'], 'Complete Name'),equals(triggerOutputs()?['body/Editor/DisplayName'], 'Complete Name2')),equals(triggerOutputs()?['body/GlobalHoldStatus/Value'],'Send'))

 

Thank you very much!

Hi @Danna 

 

Try the below

 

@and(or(equals(triggerOutputs()?['body/Editor/DisplayName'], 'Complete Name'),equals(triggerOutputs()?['body/Editor/DisplayName'], 'Complete Name2')),equals(triggerOutputs()?['body/GlobalHoldStatus/Value'],'Send'))

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (4,804)