Power Automate a flow based on Forms submittal

Iron Contributor

Hello, I'm trying to automate some workflow based on a Forms submittal. I'm trying to use Power Automate, but not sure where to start. How do I get to the back-end spreadsheet where the responses are stored? How do I build a Power Automate flow, if I can't get to the responses? Thanks!

9 Replies

@Jleebiker you can use a flow in Power Automate to get each response as it comes in and then do various things with it like add the answers to a list in SharePoint and/or send an email. What you can't do is to run a flow against responses that have already come in as there is no way for Power Automate to get at those responses.

 

So your flow needs to be set up in advance. Your trigger will be the only Forms trigger available which is "When a new response is submitted". Your first action will be to "Get response details" and for the Response ID field you select from the dynamic content box "List of response notifications Response Id" which is the only thing you can select.  After that you can add other actions and in the image I am getting the user details because the form was internal and we can then personalise the email that goes back to them.

 

0-trigger-details-user.png

 

Come back with any other questions about build your flow from a Forms response.

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User.
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

@RobElliott Thanks! I figured out how to get to the Form responses.
I have it emailing me when I get a response, but trying to figure out how to pull info from the response and work with it and forward it to different recipients.
I need to do some conditional routing based on the responses in a specific field. The responses are entered from a list of choices in the form so it will be a known list.
Having it pull the submitter's email and sending them a reply would be awesome as well!

@RobElliott So I'm doing some conditional branching. What is the best practice for having branches for 14 conditions? Where, how is best to put the conditions in?

Jlee_Prosci_0-1597410898578.png

 

@Jleebiker you don't want to use a condition in that case if you are just looking at the answer to the "Please select....." question. Instead you should use a type of condition called a Switch. That will add "Cases" to your flow: in case the answer is Adobe then do x, y and z; in case the answer is Microsoft then do x, y and z etc. You can up to 27 of these cases in each Switch. In the example below the email goes to a different person depending on the department selected.

 

switchDepartment.png

 

As you will have to have the actions in each case channel don'#t forget you can copy actions to your clipboard from the 3 dots at the top right of each action and then in other channels select the action from the clipboard.

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

@Jleebiker you said "Having it pull the submitter's email and sending them a reply would be awesome as well!". That's very easy to achieve: if the responders are in your organisation then Forms already know who they are and you just need a Send an email (V2) action and in the To field you select Responder's email from the dynamic content. Or you can personalise the email by adding the Office 365 users Get user profile I mentioned earlier, add the Responder's Email into the field in that action. Then in the Email you can say Hi and select Given name from the Get user profile section of the dynamic content. We always do this to send the responder a confirmation of the details they submitted in the form.

 

If the responders are potentially outside your organisation so you've asked them in your form for their email address and first name then you just select the email address question in the dynamic content for the To field, and the first name question for the "Hi [first name]," part of the email.

 

personalisedEmail.png

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

@RobElliott 

Thanks! One question though, what does the "Mail" object in your example provide that is different from the 

Jlee_Prosci_0-1597413132815.png

object? How are they different?

@Jleebiker both of the email actions are using the Send an email from a shared mailbox action. The Mail in the To field is because in my company - due to the way our emails are set up - if we just use the Responder's Email it gives an email address in the format P123456@ company.com. That's fine and the email would get to them, but I prefer to get their "real" email address because we add that into the SharePoint item that gets created. We can get that from Mail in the Users Get user profile (v2) section of the dynamic content. It's not a problem you are likely to face.

 

sendEmail-Mail.png

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

@RobElliott is it possible to summarise responses to a form on a daily basis and send one email instead of one email per response?

@Rahim_UoB yes but you would need to save each response into a SharePoint list, you can't do it just from the spreadsheet behind the form. Then your flow would get the items from the list with a filter query set to just bring back responses since the previous day. Instead of the normal apply to each you would need a Select action to get the responses, then a create html table action to build the table then a compose action with the CSS styles for the table. Finally you'd add a send email action and put into it the outputs of the previous compose action. We do this daily where a list of desk bookings goes to the relevant building receptionists. The original booking is made via a Power App instead of a Forms form but the follow-on actions are the same.

1-Flow.png

 

2-Flow.png

 

3-Flow.png

 

4-Flow.png

 

5-Flow.png

 

6-Email.png

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User