cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
PaolaM
Level: Powered On

Building Flow: How to send Forms responses to an email where responses are in the body of the email?

Hello,

 

Right now, Forms doesn't send the form creator a notification email with the form response as an email attachment.  So, I'm trying to building a Flow that takes the responses from a Form I've created and sends me an email with all of the responses in the body of the email.  

 

So far, all of the users have the url link to my form. I've found a template that sends an email notifcation that a Form has been completed, but it doesn't deliniate the responses in an easy-to-read email message.  Basically, I'm looking for the Flow to function as follows.

 

 

  • User fills out form, hits submit
  • An email is sent to me and three of my work colleaugues, notifying us a form has been submitted
  • The body of the email to me and my colleagues, is structured so that the question and answers from the Form looks like this:
    • Subject: New License Agreement Request: From <User> dated <date of submission>
    • Body:
      • "Question 1 - Name: User's response"
      • "Question 2 - Property: User's response"
      • "Question 3 - Tenant: User's response"
  • Send user back a generic response e-mail with follow up instructions like:
    • "Thank you for submitting your request.  Please remember to foward a PDF of the space to name@email.com."  -Thanks  - Legal Department"
12 REPLIES 12
Super User
Super User

Re: Building Flow: How to send Forms responses to an email where responses are in the body of the email?

@PaolaM :

The Flow below works and can serve as a prototype for you.

 

You'll notice that you have an expression one of the send email actions.  Here is the expression that I used.

formatDateTime(body('Get_response_details')?['submitDate'],'MM-dd-yyyy')
 
FormsEmail1.jpgFormsEmail2.jpg
 
If this addresses your issue, please mark your post as Solved.
If you like my solution, please give it a Thumbs Up.
 
Scott
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
PaolaM
Level: Powered On

Re: Building Flow: How to send Forms responses to an email where responses are in the body of the email?

Here's what I"m working with:

Capture.PNG

 

 

Where do I put the "formatDateTime(body('Get_response_details')?['submitDate'],'MM-dd-yyy')" expression?

 

In my photo above, under "Get Response details 2" what should I put in the "Form Id" field and the "Response ID" field>

Super User
Super User

Re: Building Flow: How to send Forms responses to an email where responses are in the body of the email?

@PaolaM 

You want to reference ResponseID from Dynamic properties for ResponseID 

FormsID.jpg

 

The expressions is used in the subject line of the email where you want to include the response date - see my earlier screen shots.

 

Scott

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
PaolaM
Level: Powered On

Re: Building Flow: How to send Forms responses to an email where responses are in the body of the email?

@ScottShearer 

 

After I added the Response ID as you instructed, I hit save and I got an error message in the red banner that says: 

The template validation failed: 'The action(s) 'Get_response_details' referenced by 'inputs' in action 'Send_an_email_notification' are not defined in the template.'

 

Capture3.PNG

Super User
Super User

Re: Building Flow: How to send Forms responses to an email where responses are in the body of the email?

@PaolaM :

The error message relates to the send email actions.  Can you please expand the send email actions and post a screen shot so that I can see what the issue might be?

 

Scott

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
PaolaM
Level: Powered On

Re: Building Flow: How to send Forms responses to an email where responses are in the body of the email?

Capture 7.PNGCapture8.PNGCapture9.PNGCapture10.PNG

Spoiler
 

 

 

@ScottShearer 

Super User
Super User

Re: Building Flow: How to send Forms responses to an email where responses are in the body of the email?

@PaolaM 

Can you post a screen shot of the full FormatDateTime expression?

 

Thanks,

Scott

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
PaolaM
Level: Powered On

Re: Building Flow: How to send Forms responses to an email where responses are in the body of the email?

@ScottShearer 

 

I don't know how to grab the full screenshot (see below), but the full text reads - 

formatDateTime(body('Get_response_details')?['submitDate'],'MM-dd-yyy')
 
Capture11.PNG
Super User
Super User

Re: Building Flow: How to send Forms responses to an email where responses are in the body of the email?

@PaolaM :

 

Try changing the date format to 'MM-dd-yyyy'

 

I just noticed that I had a type in my post where I had 'MM-dd-yyy' - it should be either yy or yyyy.

 

Scott

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
PaolaM
Level: Powered On

Re: Building Flow: How to send Forms responses to an email where responses are in the body of the email?

Thanks @ScottShearer .  Now I have two new issues:

 

The email to my team looks like one giant, run on paragraph (see below).  How can I separate the information so that it looks more like this:

 

1. Username: Name

2. User email: ahd@email.net

 

Capture12.PNG

 

 

Plus I received the following Flow Run failed response

 

Capture13.PNG

Capture14.PNG

Super User
Super User

Re: Building Flow: How to send Forms responses to an email where responses are in the body of the email?

@PaolaM :

Can you verify that the "Is HTML" question in th advanced section of the send email config is set to true?

 

Scott

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
PaolaM
Level: Powered On

Re: Building Flow: How to send Forms responses to an email where responses are in the body of the email?

@ScottShearer 

 

Yes, there are set to true for both 'Send an email notification' sections:

 

Capture15.PNGCapture16.PNG

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 116 members 4,593 guests
Please welcome our newest community members: