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

Flow Expression to define To email address

I am looking for some help creating an expression to decide who to email a flow.  I have a flow set up to send an email when a record is changed in a sharepoint list.  I want the flow expression to pick the correct email address based on the location of the item being emailed.  Kind of like below.  Any ideas how to do this in the to field using an if expression? 

 

If(

    Location Value = "site1", “manager1@gmail.com”,

    Location Value = "site2", “manager2@gmail.com,

    Location Value = "site3", “manager3@gmail.com, false)

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

This example may work for you. 

I am using a switch statement to evaluate which site was selected.  Then, I store the appropriate email address in a variable.

When I send the email, I simply use the variable as the email address.

 

EmailVar1.jpgEmailVar2.jpg

 

If this works for you, please mark your post as solved.

If not, please provide an explanation as to why this doesn't work and I will try to assist.

 

Scott

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

3 REPLIES 3
Super User III
Super User III

This example may work for you. 

I am using a switch statement to evaluate which site was selected.  Then, I store the appropriate email address in a variable.

When I send the email, I simply use the variable as the email address.

 

EmailVar1.jpgEmailVar2.jpg

 

If this works for you, please mark your post as solved.

If not, please provide an explanation as to why this doesn't work and I will try to assist.

 

Scott

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

I cant seem to get the option to Initiate Variable. 

 

Nevermind I found it..... testing now.

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (9,359)