Do you need to send an email based on your Microsoft Forms responses?
suppose you have a form with a choice question and you want to email the response to different people depending on what choice a user selected.
This can be done with a Power Automate cloud flow that’s triggered based on the form submission.
This post will show you how to set up a flow that sends an email based on the form response.
Create a Form
For this, you will need to create a form in Microsoft Forms.
This example has a simple form with a Choice field for three different departments as well as a rating and feedback form.
Based on the department selection the form response will be emailed to the correct department personnel.
Create a Cloud Flow
Now that you have a form set up, you can create a cloud flow that will be triggered when the form is submitted.
- Click on the Create tab.
- Select Automated cloud flow from the options.
- Give the flow a name in the Name flow field.
- Select the When a new response is submitted trigger.
- Click on the Create button.
This will open the flow builder and the When a new response is submitted trigger will need to be filled in.
- Select the form from the Form Id dropdown list.
- Click on the New step button.
Get the Form Response
Unfortunately, the trigger does not contain the form response and you need to add another action to get this content into the flow.
- Search for form in the search bar of the Choose an option menu.
- Click on the Get response details option. You might need to first select the Forms connector and then select the Get response details action.
- Select the same form as the trigger in the Form Id dropdown of the Get response details action.
- Add the Response Id dynamic content from the When a new response is submitted trigger.
Add a Condition or Switch Action
If you only have two options that your email is based on, then you can use a Condition action to conditionally send the email based on the responses.
In this example, there are 3 possible departments and the email will need to be sent to 3 possible different users based on the result. It will be easier to use a Switch action to manage these conditions.
- Add a Switch action.
- Add the choice form response dynamic content to the On field. This is the response that will determine what email to send and to who.
- Add the first choice option from your form into the Equals field of Case 1. In this example, it’s the Marketing department.
- Add the Send an email (V2) action to Case 1.
- Add the To, Subject, and Body details for the email. This is the email that will be sent when the option in the Equals field is chosen in the form.
- Click on the Add case button (plus sign) to add a Case 2 in the Switch action.
- Add the next choice option in the Equals field for Case 2. In this example, it’s the Sales department.
- Add a Send an email (V2) action to Case 2.
- Add the To, Subject, and Body details for the email. This is the email that will be sent when the option in the Equals field is chosen in the form.
You can repeat this process of adding cases to the Switch action for each option in your form. You can then add the final email for the last choice option into the default case of the Switch action.
Now you will send an email to the correct person each time the form is submitted!
Conclusions
The default email notifications in Microsoft Forms don’t give you a lot of customization options.
Thankfully, it’s fairly easy to set up a flow to automatically send emails with the form response details. You can even send the emails based on a choice selection in the form, so the email notification will go to the correct person.
Have you created a flow based on a form response before? Do you have any tips for this? Let me know in the comments!
Hi John,
Thank your article it is really useful.
Could you suggests how to put all response at once in mail body?
I tried to use output method and it works well, I can see properties values, but instead of properties names I received ids.
Look at the output for the form response and reference the desired items from the JSON with index numbers and keys as required.
Hello, can you please help me with how to do this but with an approval? This is the most straightforward flow that I’ve seen but maybe I need to do something else for sending approval requests to direct supervisors based on the form response.
You might need to use the Office 365 connector to get the users manager. You can also get more detailed help on the Microsoft Power Automate forum.
Hi John, in general, this works great, but the email is always sent from my (admin) account. I need the mail sent from the mail-account of the user, that filled out the form. Setting the term “Responders email” as sender causes the flow to fail, throwing an error “You are not authorized to send an email on behalf of the specified sending account”. Microsoft suggests, that I should allow my account to send as or on behalf of the sender – I consider that as a bad joke, since I don’t really want to allow an admin to send mails as any other company employee.
I hope, you have a solution for that!
Greetings, Julia
Power Automate can’t supersede your security access.
Send an email from a shared mailbox (V2) that everyone has access to and set the Reply To field as the user who summitted the form?
I’m guessing replies are the reason it has to come from the user.
Good idea, John, thank you! I’ll try that.
Hi John.
Thanks for the above it is really helpful.
Does the process work in the same way if there are multiple questions in the form?
As an example – if you selected sales then the next question asked for a specific office?
Your form uses branching? Tbh, I’m not sure.
You might need to adjust the dynamic content reference to use a
?
so if the question isn’t answered it returns a null instead of an error.@{triggerBody()?['Office']}
instead of@{triggerBody()['Office']}