cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Super User III
Super User III

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

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

Highlighted
Helper I
Helper I

Re: Flow Expression to define To email address

I cant seem to get the option to Initiate Variable. 

 

Highlighted
Helper I
Helper I

Re: Flow Expression to define To email address

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

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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
Top Kudoed Authors
Users online (8,260)