How to Send an Email Based on Form Response in Power Automate

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.

  1. Click on the Create tab.
  2. Select Automated cloud flow from the options.
  1. Give the flow a name in the Name flow field.
  2. Select the When a new response is submitted trigger.
  3. 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.

  1. Select the form from the Form Id dropdown list.
  2. 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.

  1. Search for form in the search bar of the Choose an option menu.
  2. Click on the Get response details option. You might need to first select the Forms connector and then select the Get response details action.
  1. Select the same form as the trigger in the Form Id dropdown of the Get response details action.
  2. 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.

  1. Add a Switch action.
  2. 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.
  3. Add the first choice option from your form into the Equals field of Case 1. In this example, it’s the Marketing department.
  4. Add the Send an email (V2) action to Case 1.
  5. 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.
  6. Click on the Add case button (plus sign) to add a Case 2 in the Switch action.
  7. Add the next choice option in the Equals field for Case 2. In this example, it’s the Sales department.
  8. Add a Send an email (V2) action to Case 2.
  9. 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!

About the Author

John MacDougall

John MacDougall

John is a Microsoft MVP and freelance consultant and trainer specializing in Excel, Power BI, Power Automate, Power Apps and SharePoint. You can find other interesting articles from John on his blog or YouTube channel.

Related Articles

Comments

9 Comments

  1. RredCat

    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.

    • John MacDougall

      Look at the output for the form response and reference the desired items from the JSON with index numbers and keys as required.

  2. Caitlin

    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.

    • John MacDougall

      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.

  3. Julia

    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

    • John MacDougall

      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.

      • Julia

        Good idea, John, thank you! I’ll try that.

  4. Alistair Reid

    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?

    • John MacDougall

      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']}

Get the Latest Tech Tips

Write For Us

Are you a tech enthusiast with a talent for writing great content? Come write for us!

Follow Us

Follow us on social media to stay up to date with the latest in tech!