Forum Discussion
POWER AUTOMATE FLOW - CONVERT MS FORM TO PDF & SEND VIA EMAIL
Hello,
I am relatively new to Flows. But, I've created a few for my team. I am trying to create a flow that will take a MS Form response & convert it to a PDF and send an email. I keep getting hung up and it says the test is invalid. I see that the results are coming in, but it's failing to convert utilizing the OneDrive business convert feature. Does any one know the work around for this? Thank you in advance.
- Damien_RosarioSilver Contributor
Hi JDeeb
It's probably failing as the OneDrive Convert file option is expecting a file to convert to PDF, of which Microsoft Forms does not produce.
If you have programmed something in your flow to convert the Form to a docx file, can you please screen shot it and show more of the flow (redact any sensitive info such as URLs)?
If you wanted to streamline your process as having the details in an email rather than a file, you could have a 3 step flow with the trigger to:
1. [Trigger] Catch the new form submission (When a new response is submitted)
2. Get response details
3. Send an email (V2) - where you add in the name for each dynamic attribute so that people know what each of the responses are called in the email.
Happy to discuss further if you want to show your flow?
Cheers
Damien
- JDeebCopper Contributor
Thank you for that suggestions Damien_Rosario . I actually went with your 3 step route just creating the email like that vs trying to convert to a pdf. Our team regularly converts these forms into pdf, so I was just trying to eliminate a step. But, for now this will work. See the attached screen shot of what I tried to do. But, I can't seem to get the convert to work.
- Damien_RosarioSilver Contributor
Hi JDeeb
Yes without a file for the convert process to change to PDF, the flow will fail.
I haven't had a chance to test out a solution I have in mind, but you can have a play first and see if it does the trick.
1. After Get response details, add something like a Compose action and then set up your form headings and add the dynamic content.
2. Add the OneDrive for Business connector action Create file, and create your file from the Compose output.
3. From there you could use a connector like Encodian or Clavin Fernandes's suggestion like Muhimbi which have free accounts to use for converting files to PDFs.
4. Add the OneDrive for Business connector action Create file, and create your file from the PDF converter output.
5. Send an email and attach the file. See below as my browser crashed and I had to rewrite this.
Set Attachments Name to the name of the file you want (should be the same as step 4 if you have used step 4).
Set Attachments Content to the output from your PDF converter.
This should allow you to email a PDF to staff. Feel free to substitute the compose box option for something with a bit more formatting options if you want. I went with the easiest one I use when I just want to get stuff moving.
I also removed the OneDrive convert action as it does't work with what I have proposed above.
Hope that helps!
Cheers
Damien
- Clavin FernandesCopper Contributor
Hi, I use the "Muhimbi" Connectors "Convert HTML to PDF" action to Convert Microsoft Form's to PDF.
In the above screenshot, I create an HTML and then insert the Microsoft Forms list fields in the appropriate places just before each line’s <br/> element.
For more details you can refer to my blog, https://clavinfernandes.wordpress.com/2019/01/29/convert-response-from-microsoft-form-to-pdf/
and if you want to Convert Microsoft Form's with attachment, see: https://clavinfernandes.wordpress.com/2020/01/01/convertmerge-microsoft-form-attachments-to-pdf/
- JDeebCopper Contributor
Clavin Fernandes thanks for the suggestion. I see you have to pay for it and I was trying to avoid that with the free OneDrive Business convert connect, but it doesn't seem to work.
- Clavin FernandesCopper Contributor
JDeeb Muhimbi Converter Service Online(Power Automate) is a subscription-based service. They also have a Free Subscription, you can find details about pricing at http://www.muhimbi-online.com/Pricing
- e_evseychikCopper Contributor
This topic is quite old but I decided to post because JDeeb mentioned that he had troubles with converting to PDF using the OneDrive connector. In fact, Damien_Rosario already suggested the solution here but I would follow up his answer with some screenshots and optimized flow structure. Also, I will suggest an advanced solution at the end of my reply.
So, here is the flow I would suggest.
- When a new response is submitted.
- Get response details.
- Create an HTML file using the OneDrive connector. Its content can be provided as raw marked-up text. Apply the required formatting using HTML tags and CSS styles and embed the dynamic content from the submitted response. I used just a basic HTML structure.
- Convert the HTML file to PDF using its ID.
- Finally, send the converted file through e-mail.
- Flow overview.
- Here is a result file I received by e-mail.
Advanced form conversion to PDF
The solution above is good because it does not involve other paid products but it may be convenient not for all:
- it may be hard to apply the required formatting using HTML and CSS;
- HTML does not provide as much tools to build a document layout as text editors;
- it may be necessary to embed uploaded documents as well, not just text of responses.
To solve these and maybe other issues, it is necessary to use third-party tools. Other users already advised Encodian and Muhimbi ‒ I would add Plumsail Documents to those options. There is a detailed guide accompanied with a video instruction showing how to convert Microsoft Form responses to PDF. Though, the last step in the suggested flow is saving the PDF file to a SharePoint library but it can be easily replaced with the 'Send email' step I advised above.
- When a new response is submitted.