Convert responses from Microsoft Form to PDF

Microsoft Forms provides us with a quick and easy way to create surveys, quiz’s etc. The response to these Forms can be saved in SharePoint list or can be sent over email using Microsoft Flow but how can we save the responses as a PDF in the SharePoint Online Document Library?

In this Blog, we will use the Muhimbi “Convert HTML to PDF” Microsoft Flow action to Convert the Microsoft Form response to PDF and save it in a document Library.

Please make sure the following prerequisites are in place:

  • An Office 365 subscription with SharePoint Online license.
  • Muhimbi PDF Converter Services Online full, free or trial subscription(Sign up).
  • Appropriate privileges to create Flow.
  • Working knowledge of SharePoint Online, Microsoft Flow and Microsoft Forms.

For this demo, we will convert the Sample Microsoft Form (below) to PDF.

From a High level our Flow will look like:

Step 1:

Add the “When a new response is Submitted” trigger action. It will trigger the flow when a new response is submitted.

In the trigger action specify the “Form Id” of the Microsoft Form.

Step 2: 

  • Add the “Get response details” action. This action retrieves a form response.
  • Specify the “Form Id” of the Microsoft Form
  • For the “Response Id” add the output “List of response notifications Response Id” of the “When a new response is Submitted” trigger action.

When you add the next action(Convert HTML to PDF) the “Get response details” action will automatically add “Apply to Each” loop.

Step 3:

  • This is where the real Magic happens. Add the Muhimbi “Convert HTML to PDF” action.
  • Copy the HTML fragment provided below in the ‘Source URL or HTML’ area in the Muhimbi ‘Convert HTML to PDF’ action and then insert the various list fields in the appropriate places just before each line’s <br/> element.
<h2>Help us Improve</h2>
Responders Email:<br />
Submission time :<br />
Feedback:<br />

Step 4:

Use the “Create file” SharePoint action to write the PDF document to the SharePoint document library.

  • File name: For this Demo, we will use “Feedback(Responder’s Email).pdf” (output variable of the “Get response details” action).
  • File content: Processed file content the (output variable of the “Convert HTML to PDF”)action.

Step 5:

All done! Now it’s time to test our Flow.

  • Open the link\URL for the Microsoft Form in the browser and submit a Form.
  • The Flow will be triggered automatically and a PDF should be created in the SharePoint Document Library.

Happy Converting.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s