web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / If Statement Expressio...
Power Automate
Answered

If Statement Expression in Email Power Automate Flow

(0) ShareShare
ReportReport
Posted on by

I have created an email flow to send an approval request to the manager associated with the sender's outlook id. However, there is a specific list of people whose requests need to be re-directed to a specific email address instead of to their associated manager's email. It seems like I could just write an if statement in the dynamic expression for who it's assigned to. 

 

Here is the code I'm attempting to put in the dynamic Expression:

if(triggerBody()?['Author']?['mail']=employee1@gmail.com||employee2@gmail.com, specificemail@gmail.com, body('Get_manager_(V2)'?['mail']))

Here is the flow: 

flow_expression.JPG

 

Categories:
I have the same question (0)
  • ScottShearer Profile Picture
    25,270 Most Valuable Professional on at

    @Anonymous 

    You can't use the equal sign, pipes, etc..  You must use operators such as equals(), or()

    I may have missed a paren somewhere, but it should look something like this:

     

    if(or(equals(triggerBody()?['Author']?['mail'],employee1@gmail.com),equals(triggerBody()?['Author']?['mail'],employee2@gmail.com)),specificemail@gmail.com, body('Get_manager_(V2)'?['mail'])

     

     

  • Verified answer
    v-bacao-msft Profile Picture
    on at

     

    Hi @Anonymous ,

     

    Please try the following expression:

     

    if(or(equals(triggerBody()?['Author']?['Email'],'employee1@gmail.com'),equals(triggerBody()?['Author']?['Email'],'employee2@gmail.com')),'specificemail@gmail.com',body('Get_manager_(V2)')?['mail'])

     

     

    Best Regards, 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard