Convert Microsoft Forms Responses to Word or PDF

This article demonstrates how to export Microsoft Form to Word document and convert the resulting file to PDF. It may help to automate the creation of certificates, applications, requests, and other documents from Microsoft Forms.

To follow the steps from the article, you will need these accounts:

We’ll connect Microsoft Forms to Plumsail Documents using the Power Automate (Microsoft Flow) platform. We’ll create an automated flow to automatically export data from a Microsoft Form, apply the data to our Word template, and generate a new PDF document. We’ll also take a look at the case when the MS form has an image upload in the Advanced Case section.

You can watch the below video to understand the logic. Otherwise, follow the steps from the article.

Create Microsoft Form

First, you need to create a Microsoft form. We наve already created a guest’s request form. We will use data from its submission. If you haven’t created MS Forms before, follow the link to learn how to do it.

It’s possible to use the form from this example. After you’ve logged into your Microsoft Forms account, click on the link to duplicate the form. After duplicating you’ll be able to use the form as your own.

Below is a screenshot of the form:

Microsoft Form

Configure Plumsail Documents Process

Next, you need to go to your Plumsail account - Processes section - and add a new process:

add new process

Set the Process name. Select DOCX for a template type.

Configure Word template

Once the process is created, you’ll see the Configure template step including two substeps:

  • Editor;

  • Settings.

In Editor, you can compose the template from scratch or upload a pre-made one. It’s also possible to modify the uploaded template online.

Feel free to download a DOCX template we have prepared beforehand. It’s a guest’s request:

Docx template

Then upload it to the process.

upload template file

Templating syntax

When creating your own templates, mind the templating language. Plumsail Word DOCX templates use a different approach than most other templating solutions. It uses a minimal amount of syntax to make your work done.

In short, the templating engine thinks that everything between curly {{ }} brackets is variables where it will apply your specified data.

Press Save&Next to proceed further - to the Settings substep:

  • Switch to an active mode to remove Plumsail watermarks from resulting documents

  • Fill in the name of the result file

  • Select PDF as the output file format to convert the resulting document to PDF

  • Select locale

  • Protect the result PDF if you wish

Configure template

Delivery

The next step is delivery. For demonstrating purpose, we’ll store the result file in OneDrive. But there are other options.

Select the folder where the ready document will be saved. Fill in the file’s name.

create pdf from template on form submission

You can configure as many deliveries as you need. For instance, you can also save the resulting PDF in SharePoint.

Start Process

We will start our Process from Power Automate (Microsoft Flow).

Create Flow

This is how our Power Automate Flow looks:

pdf from Microsoft Form flow

Check out the Power Automate Flow steps described below.

Form is submitted

We need to start the Flow every time somebody submits our request form. For that, search for Microsoft Forms in Power Automate and set When a response is submitted as a trigger.

If this is your first Flow with Microsoft Forms, on this step, sign in to your forms account from Power Automate to use your forms inside Flows.

Then, you’ll need to pick the form you want to track from the dropdown.

Microsoft Form trigger

Get response details

As we want to extract data from Microsoft form, we need to add Microsoft Forms - Get response details action. On this action, we select the same Form Id that we used in the trigger. Then, we click in the Response Id text box and pick List of response notifications - Response Id in the Dynamic content menu on the right:

Get response details

Start document generation process

This is the action from Plumsail Documents connector. This action is suitable for starting the Process of generating documents from a template. You can find more information about this action by visiting this page.

Using the action for the first time, you’ll be asked for ‘’Connection Name’’ and ‘’Access Key’’.

create flow connection

You can type any name for the connection. For example, ‘’Plumsail Documents’’.

Then create an API key in your Plumsail Account page, copy and paste it to ‘’Access Key’’ field.

The action has several parameters:

start generation documents action
  • Process name. Select the process you need from available ones.

  • Fields for entering data. The number of fields depends on the number of tokens in the DOCX template.

Template data in JSON format

This object contains information from our form. We selected the dynamic content from the output of Microsoft Forms - Get response details action:

Menu on the right

Use the ready document in Flow

You can stop on the step Start document generation process.

Steps described above are enough for generating PDFs from a DOCX template based on the Microsoft Form submission. Your result file will be saved to OneDrive in this case. See how it will look:

Final document

But if you need an advanced logic, it’s possible to work with the result file right in the Flow.

Here is an example of how you can send the ready document for approval.

Add an action Create an approval from the Approvals connector. Select an output of the previous step for an attachment.

send pdf for approval

Advanced Case: MS Form with image upload

Let’s imagine that we want our requester to submit a photo of their problem:

DOCX with image

To achieve this, we will add an image upload option to the Microsoft Form and then include the uploaded image in the resulting PDF.

The Microsoft Form may look like this:

Microsoft form with image attachment

Then, we add a new token {{imageData}:picture} with the picture formatter to insert the image into the DOCX template.

Microsoft form with image attachment

Download the DOCX template with the image token.

Also, we need to add some actions to our flow to process the image:

Power Automate flow

First, we add Parse JSON action to get the image dynamic content.

Power Automate flow

We generate the scheme from a sample. To get the sample we can run our flow with just Get response details action and copy the line from the image field.

Power Automate flow

Then click Generate from sample in the Parse JSON action and insert the copied sample JSON payload.

Power Automate flow

On the next step we get the image file content with the help of OneDrive for business connector and use id dynamic data from the Parse JSON action.

Power Automate flow

Note

Power Automate automatically adds Apply to each action.

Finally, we add the Start document generation process action and select the dynamic content from the OneDrive for business action. We need to use this expression to get the file content though.

body(‘Get_file_content’)[‘$content’]

Power Automate flow

That’s it! The flow to convert Microsoft Form responses and an image attachment into a PDF is complete.

Sign up for Plumsail Documents

As you can see, it’s simple to automate the generation of documents on Microsoft Forms submission. If you’re new to Plumsail Documents, register an account and follow the steps described in the article to set the process for automatic creation of PDFs from Microsoft Forms. A 30-day trial is free.