cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NickT
Microsoft
Microsoft

Email recipient based on Form response

I am using a Microsoft Form to collect input from users, and want to email the form results to a recipient based on the response to one of the questions. The question requires the user to select from a list of 10 choices, and I want to do a lookup to determine the corresponding email recipient for each choice.

 

I am currently using a deeply nested if-then flow to implement this. It works, but I want to make this easier to maintain by maintaining a lookup table - either in the flow itself or externally in Excel, and passing the corresponding email address to the "Send an email (v2)" action. Would really appreciate a sample or pointers on what components to use to implement this.

 

Capture.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
NickT
Microsoft
Microsoft

I ended up using Switch after all.

The 1st switch simply sets the MailTo variable to one of 10 email addresses based on a response in the form, which I use later in the "send an email" action.

I ended up adding a 2nd switch to host the send email action so I could use different email templates.

 

Capture.JPG

View solution in original post

3 REPLIES 3
RobElliott
Super User
Super User

@NickT instead of using nested conditions it would be better if you used a Switch control which is a type of condition and just looks at one thing, in your case the selection from the 10 choices. Depending on what is chosen then you have the actions in each case channel. With a Switch you can have up to 27 cases (i.e results from the switch) and it makes it much easier to maintain.

 

SwitchCase.png

 

 Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

Thanks for the response Rob.

Switch is definitely an improvement on nested if-then conditions, but it still requires that I maintain the 10 switch branches. If I want to update the email text, I need to update this in 10 places etc.

I am really looking to do the response -> recipient lookup in the flow, set this as a variable, and pass this to the recipient field of the "Send an email (v2)" action.

NickT
Microsoft
Microsoft

I ended up using Switch after all.

The 1st switch simply sets the MailTo variable to one of 10 email addresses based on a response in the form, which I use later in the "send an email" action.

I ended up adding a 2nd switch to host the send email action so I could use different email templates.

 

Capture.JPG

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (4,416)