cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Teaners26
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
ScottShearer
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

4 REPLIES 4
ScottShearer
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.

Hi Scott,

If the location value allowed multiple sites, so both site 1 & site 2 are selected, how could you send one email to sitemgr1@email.com; sitemge2@email.com?  That is I want each site manager to know they have received the same email.

Thanks very much

Jon

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors
Users online (2,484)