cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
New Member

Send emails to different people based on a form response

Hi, 

I have never used flow before and would really love some help!

 

I want to use Flow to send emails to different people with the whole response to the form depending on which multiple choice option was selected when a user fills out a Microsoft form. For example, if business office was selected, then the response to the other questions on the form will only be sent to email 1 and email 2. If advertising was selected, then it will be sent to email 3, but not email 2 and email 1. I set it up the form as a "form for excel", if that helps make the flow easier. 

 

Please let me know what I can do. Thank you!

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @lhl,

 

I think what Scott means is to use Forms-When a new response is submitted as a trigger, and then use Get response details to get the submitted options.

Then configure the Condition to determine the email to be sent to the specified email address based on the submitted options. Or you can use the Switch.

Image reference:

Forms:

14.PNG

Flow:

13.PNG

Please take a try.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

19 REPLIES 19
Super User III
Super User III

@lhl:

 

It sounds as though you want to send emails to different people depending on the response to a particular question in Forms. 

 

Is there a reason why simply using a condition(s) or a Control Switch action will not work for you?  If the resposne is A, then send email to person A and person B, etc..

 

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

Hi Scott,

Perhaps I could, but I tried to find a template to start writing the flow but I could not! Since the form is stored on sharepoint because it's part of a group, what would my trigger be? Would it be forms or sharepoint? If you can direct me to some kind of guide, it would be great! Thank you!

Hi @lhl,

 

I think what Scott means is to use Forms-When a new response is submitted as a trigger, and then use Get response details to get the submitted options.

Then configure the Condition to determine the email to be sent to the specified email address based on the submitted options. Or you can use the Switch.

Image reference:

Forms:

14.PNG

Flow:

13.PNG

Please take a try.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

 @v-bacao-msft THANK YOU so much! That worked perfectly!!

I have a form that needs to be sent to one of 17 people based on the responce to one question - as in the choice example given by @v-bacao-msft will have 17 options instead of 2.

 

Is the only way to set this up to repeat the condition step for each response? Or is there an other option?  

Thanks for this!

 

Strangely, I can't get the condition control to pull the choices option from my form?

 

Cheers,

 

Karl.

 

@DataFailure did you get a repsonse on this? I am looking to create a flow that would send an email to a different person based on the choice in the previous question

Hi @lmiller 

I didn't get a reply from the community on this, but have managed to jury rigged an inelegant process that is working for now. It basically involves a dedicated flow for each person who needs to receive a notification of the form, those flows use a condition to look for what is specific for that person using the and/or options. 

The process starts with this:
Capture 10.PNG

 

The each person has a flow that starts out like this
Capture11.PNG

The reason that I've given each person their own flow is that there are a lot of subsequent actions from the 'If yes' side and it just made it easier for me to keep track of everything. 
For the condition you'll put the dynamic tag for the question that previous question in the left hand side box and then type in what you want it to equal/contain etc in the right hand box. This was helpful for me for figuring out whether to use the And/Or options and groups https://flow.microsoft.com/en-us/blog/build-more-powerful-conditions-in-flows-and-more/

If the only follow on connector from your condition is to send an email you might be able get away with having everything in one flow and just use the no branch to trigger another condition looking for the next option on your form. Also you might be able avoid using sharepoint if you don't need anothing recorded from those emails
 
Hope this is helpful!

Hi! I'm wanting to do this exact same thing, but for 45 people. Is there an easier way to do this than add a condition for each?

When I try setting this up, my responses don't come up for me to choose if response is...I want to send one email to everyone who responds they work in our district and a separate email to everyone who responds they are outside our district. Thanks for any help!

Monica

@v-bacao-msft,

 

I am following the steps listed in your solution - however, when I add the second step (Apply to each), it says there is no dynamic content available, and I cannot enter "List of responses" in that field. Do you have any thoughts on why that might be the case/how to resolve this? Thank you!

 

Hi @jchen172 ,

 

You do not need to add Apply to each, please configure Get response details action directly.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you @v-bacao-msft. My form is a symptom screening. I want to send one email if respondent says "no" to all four symptoms questions (fever, unexplained cough/sore throat/shortness of breath), and send a separate email if respondent says "yes" to any of four symptoms. Every time I test the flow, it says there are issues with my Condition. The error message for Condition says:

ActionFailed. An action failed. No dependent actions succeeded.
 

Do you know what the issue might be?

Screen Shot 2020-04-06 at 10.00.10 PM.png

yes there is an easier way which can cope with multiple email addresses

add in a step to initialize variable

assign a name like "Friendly email addresses"

set type to string

and in value choose the expression - Replace(text, oldtext, newtext)

 

for the first text click on dynamic content and select your forms response item

e.g.- replace(triggerBody()?[‘text_1’],”oldtext”,”newtext”)

use the old text and new text to replace the special characters, you can replace multiple characters

for each additional character you want to replace add

replace(

at the start of the expression and then add

,”oldtext”,”newtext”)

at the end of the expression

so for example to remove the [" from multiple response forms and replace the "," with a ; 

your expresion should look like this

replace(replace(replace(triggerBody()?[‘text_1’],'","','; '),'["',''),'"]','')

(replace the triggerBody()?[‘text_1’]  with your own dynamic content)

 

Hope this helps.

 

Frequent Visitor

Hey guys,

 

What if the selected option from the form response is multiple selection.

And this format like this when sent via email.

 

["[\"Victoria Island\",\"Mainland\"]"] 

["Victoria Island","Mainland"]

 

How do we break that array output view?

 

Hi,

 

i have created something similar to this and i keep receiving this error:

The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@triggerBody()?['resourceData']?['responseId']' is of type 'Integer'. The result must be a valid array.

 

is there any way to solve this? 

 

Thanks,

 

@TLC_525, did you ever get a response or figure out a simpler way to send to 45 different people depending on the form response?

Here's what I found that worked for me: https://powerusers.microsoft.com/t5/Building-Flows/Get-Email-Address-from-SharePoint-List-based-on-D...

 

I created one simple flow that found the right email from one SharePoint list to send the email message to, based on the form responses.

 

  1. Trigger - when form is submitted
  2. Get responses from submitted form
  3. Create item in SharePoint List 01
  4. Get Items from SharePoint List 02 (List 02 is my directory of email addresses) *see above link to sort out details
  5. Send email to email address stored in List 02 to which the newly created item belongs

millersmasters_0-1597084124226.png

 

Hope this helps 🙂

 

 

New Member

Hello! I tried this but I do not have the "list of responses" as an option is there another way to set up?

Helpful resources

Announcements
New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (68,426)