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
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

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.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Users online (2,306)