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!
Solved! Go to Solution.
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:
Flow:
Please take a try.
Best Regards,
Barry
@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
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:
Flow:
Please take a try.
Best Regards,
Barry
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:
The each person has a flow that starts out like this
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
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,
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:
Do you know what the issue might be?
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 the triggerBody()?[‘text_1’] with your own dynamic content)
Hope this helps.
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.
Hope this helps 🙂
Hello! I tried this but I do not have the "list of responses" as an option is there another way to set up?
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Did you know that you could restore a deleted flow? Check out this helpful article.
User | Count |
---|---|
32 | |
31 | |
24 | |
24 | |
20 |
User | Count |
---|---|
59 | |
57 | |
43 | |
37 | |
28 |