cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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
ScottShearer
Super User III
Super User III

@Anonymous :

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
Anonymous
Not applicable

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>

@Anonymous 

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
Anonymous
Not applicable

@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

@Anonymous :

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
Anonymous
Not applicable

Capture 7.PNGCapture8.PNGCapture9.PNGCapture10.PNG

Spoiler
 

 

 

@ScottShearer 

@Anonymous 

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
Anonymous
Not applicable

@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

@Anonymous :

 

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
Anonymous
Not applicable

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

@Anonymous :

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
Anonymous
Not applicable

@ScottShearer 

 

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

 

Capture15.PNGCapture16.PNG

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (25,677)