cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Teaners26
Level: Powered On

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
Super User

Re: Flow Expression to define To email address

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
Super User

Re: Flow Expression to define To email address

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

Teaners26
Level: Powered On

Re: Flow Expression to define To email address

I cant seem to get the option to Initiate Variable. 

 

Teaners26
Level: Powered On

Re: Flow Expression to define To email address

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

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Speakers, submit your sessions now! Call for speakers ends Feb. 10!

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!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,005)