Microsoft forms

Occasional Contributor
Hi guys- I’m using Microsoft forms for work. Currently we have an active form that sends an email after every submission using a flow.

I have added into the email body some specific answers.
However I wondered if there was a way to populate that same email with the completed form as an attachment?

Thanks
Dawn
17 Replies

@dawny1911 you would have to do this with a flow in Power Automate. For the IT ticketing system at my company we send an email, back to the responder with the info they submited in the form, a reference number and other inforation. We just put this in the email but in the flow you could create a PDF and send that as an attachment.

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

Hi are you able to screen shot these steps?
I would like this email to be sent to a specific email address not the responder- populated with some answers from the form.

@dawny1911 an example of a flow to send an email with a PDF attachment of the answers from a form is as follows:

 

In Power Automate create a new instant cloud flow then click skip on the next screen - I always like to start from a completely bland flow.

 

The trigger is a Forms when a new response is submitted and, as always, is followed immediately by the first action which is get response details. You might not need the following 2 actions to convert the date into UK format.
1-Flow.png

 

The next action is a OneDrive for Business create file. In this example I've selected for the filename one of the answers in the form which is a car license plate. You need to follow the filename with .html

 

For the content of the file add text and the questions from the get response details section of the dynamic content box. YOu can add html tags  to add line breaks and other formatting.

 

Next add a a OneDrive convert file using path and select Path from the dynamic content box on the right. Your target type should be PDF.

 

2-Flow.png

 

Assuming you want to keep a copy of the PDF you next add another OneDrive create file action, selecting Filename and File Content from the convert file using path section of the dynamic content.

 

3-Flow.png

 Finally add a send an email (v2), enter the email address it should go to in the To field. Add some text into the subject and body. Open the advanced options and for the attachment Name and Content fields select File name and File content from the convert file using path section of the dynamic content box.

 

4-Flow.png

 

5-EmailWithPDF.png

 ..and the content of the PDF looks like this:
6-PDFContent.png

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

Thanks so much!!

Ive managed to complete the flow however it wont let me test as it says there are 'there are no runs for this flow'

Just a quick question - for the folder path? the example you gave starts with /

Is this what I use too?

It won't let you test it from the Test menu until you have run it from a submitted form at least once. After that you can use the Test link.

The / puts the html and pdf files in your root OneDrive folder. I've found that works better than somewhere deep inside OneDrive, but you could try a different folder.

Hi guys- thanks so much this is now working and is perfect!
Just one added question- can I add an image to the “create file” file content?

I would like the document to have appear it’s in headed paper but when I copy and paste no image shows.

Thanks
Dawn

@dawny1911 you can't copy & past for images due to the way they need to be encoded in the flow. See my post here for how to add an image.

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

That’s great! Again all sorted- do you know of a way to make the image smaller? It’s come through very large when printing on the pdf
Look at the img src html tag in the link I gave you and change the width settings, or add a height setting.

Hi Rob- are you able to tell me where to add the height settings?
Currently I have <img src=“ fx data “width=100px”></img>
Also I’m looking to make the first line a heading- so I’d like to that to look larger than the other text- is there a html for that?
I would like this email to be sent to a specific email address not the responder- populated with some answers from the form.
Hi Rob- are you able to tell me where to add the height settings?
Currently I have <img src=“ fx data “width=100px”></img>

@dawny1911 either replavce the width = with height = or add in a height="150px" before the < closing tags

 

height.png

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

Hi Rob thanks for this.
One last thing- I have 1 question in the “file content” that required a < or > at the start of the answer.

The automate sends the email without that answer as it thinks it’s a hyper text?

How can I make this answer appear when it says <6 month’s?

Dawn
Hi Rob- thanks for your help with this automate- everything is working perfectly- you’ve been a great help!
Can I just check when a form is completed and the flow does it’s thing, I seem to have a weblink for each submission saved onto my 1 drive... I don’t really need this function so is there a way to stop this without ruining the whole flow?
Dawn

@dawny1911 no, you can't stop this, it's programmed that way by Microsoft.

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User