September 24, 2021

Power Automate: Forms When a new response is submitted Trigger

Microsoft Forms is a great way to collect user information, but it’s not a great place to keep information. It would be best to keep the replies in another, more permanent solution, like SharePoint, for example. Power Automate helps by providing the “When a new response is submitted” trigger to catch all submissions and parse them.

Let’s explore this a bit further in the section.

Where to find it?

You can find it in the Forms section.

Alert: Microsoft changed the way that Power Automate displays the steps. Now you have a huge list of actions that you can search. It’s arguable that this is simpler or not, but now I’ll only provide the search string you have to write to find the action.

Usage

You only need to point the trigger to your form, and you’re good to go.

You can provide an ID, but I would strongly advise against it. If you can’t see the Form in the list, it means that something’s wrong.

Outputs

The trigger returns a lot of information in a JSON format, although the conversion from JSON is done automatically for you. Here’s an example:

{
    "headers": {
        "Connection": "Keep-Alive",
        "Expect": "100-continue",
        "Host": "<redacted>",
        "X-CorrelationId": "<redacted>",
        "Content-Length": "259",
        "Content-Type": "application/json; charset=utf-8"
    },
    "body": {
        "webhookId": "<redacted>",
        "eventType": "ResponseAdded",
        "resourceData": {
            "formId": "Qm32rhvlGAeYiBIM5OXiIjeRobZjKhNHs7kaQ7pHOftUREtWOEs2UEwyTjNEAVRYRjlPWVRaMTVZUS4u",
            "responseId": 3
        },
        "eventTime": "2021-08-25T13:53:37.3238526Z"
    }
}

As you can see, there’s not of information, but we get what we need. The “formId” and the “responseId”. After that, we can call the “Forms Get Response Details” Action.

Microsoft decided to keep things separate, and we can understand why. Responses could be quite big, so the trigger will be cumbersome if it contained all details. Also, it’s less frequent, but you could want to catch the trigger but don’t need the information of the reply. For example, to warn someone that there’s a new submission.

Limitations

You can consider this a limitation or work as intended, but the “When a new response is submitted” trigger will only return IDs and not information regarding the answer. You have the “Forms Get Response Details” action that will fetch the information.

Recommendations

Here are some things to keep in mind.

Never provide the ID.

It’s a personal opinion but never provide the ID of the Form in the “When a new response is submitted” trigger (or any other for that matter). IDs can change, and selecting them from a list ensures that:

  1. If the ID changes, your Flow will continue to work.
  2. The connection and permissions are correct. So if you see the form in your list, there’s a good probability that all will work correctly.

Never hard-code IDs in your Flows unless you have a good reason to do it, and if you do, please document it extensively so that other people will understand your mindset.

Name it correctly

The name is super important in this case since we’re getting the answer from a form between potentially a bunch of them. Always build the name so that other people can understand what you are using without opening the action and checking the details.

Always add a comment.

Adding a comment will also help to avoid mistakes. Indicate the form that you’re fetching information from and what you want to do with the information is. It’s important to enable faster debugging when something goes wrong to know your intention from the beginning.

Am I missing something? Leave a comment or interact on Twitter. Let’s work together to make this reference as complete as we can

Back to the Power Automate Trigger Reference.

Photo by Manish Upadhyay on Unsplash

Manuel Gomes

I'm a Project Manager with experience in large projects and companies. I've worked in the past for companies like Bayer, Sybase (now SAP) and I'm currently working for Pestana Hotel Group.

View all posts by Manuel Gomes →

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: