Create Excel and PDF documents from Microsoft Forms in Power Automate

Modern templating engine

Still using Classic syntax? See the Classic documentation.

Learn the differences.

This article shows how to generate Excel and PDF documents from Microsoft Forms submissions using Processes and Power Automate (MS Flow).

When a user submits a form:

  1. Power Automate captures the response.

  2. The data is passed to a Plumsail Documents Process.

  3. The Process populates an Excel template.

  4. The generated document is saved and optionally converted to PDF.

This approach can be used to automate employee forms, requests, applications, orders, reports, and other business documents.

Create a Form

For this example, we will use a Microsoft Form that collects employee information. If you are new to Microsoft Forms, see Microsoft’s guide on creating forms.

You can also use the sample form from this tutorial. After signing in to Microsoft Forms, duplicate the form and save a copy to your account.

The form used in this example looks like this:

Employee information form created in Microsoft Forms

Configure the process

Before creating the Flow, we need to create a process, which will generate PDF documents from an XLSX template.

Create a new process

Open Processes in your Plumsail account and click Add process.

Then, select Uploaded file in the side panel to import your Excel template. You can use your own template or download the sample template from this example.

Add process in Plumsail Documents

Enter a name for the process, select PDF as the output format, and choose the templating engine. Finally, click Create

Configure a template

After creating the process, the template opens in the online editor.

The template used in this example looks like this:

Employee information Excel template configured for document generation

Templating syntax

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

Template placeholders are enclosed in {{ }} brackets, and when the document is generated, these placeholders are replaced with data pass to the process.

Read this article to get familiar with the templating engine.

Test template

Before building the automation flow, test the template to verify that it generates the expected document.

Click Test template and the editor will automatically generate a test form, based on the placeholders found in the template.

Automatically generated test form for an Excel template

You can adjust the look of the testing form by changing token types. Alternately, you can use a JSON example.

Test Excel template using a JSON data example

Verify that the generated document looks correct before continuing.

Settings

Use the Settings option to further customize your process.

Process settings option in the editor view

You can:

Process settings including output file name and PDF options

After updating the settings, run another test to verify the output. When everything is configured correctly, click Save.

Start the Process

This example uses Power Automate to start the document generation process when a form is submitted.

Create a Flow

The completed flow contains three main steps:

  1. Trigger when a form response is submitted.

  2. Retrieve the submitted response data.

  3. Start a Plumsail Documents Process.

Power Automate flow that generates documents from Microsoft Forms responses

The following sections explain how to configure each step.

Form is submitted

Add the When a new response is submitted trigger from the Microsoft Forms connector.

Note

If this is your first time using Microsoft Forms in Power Automate, you will be prompted to sign in and create a connection.

After signing in:

  1. Add the trigger.

  2. Select the form you want to monitor from the Form Id dropdown.

Microsoft Forms trigger configured to run when a response is submitted

The flow will now start automatically whenever a new response is received.

Get response details

Next, add the Get response details action from the Microsoft Forms connector. You should configure the action as follows:

  1. Select the same Form Id used in the trigger.

  2. Click inside the Response Id field.

  3. Select Response Id from the dynamic content panel.

This allows Power Automate to retrieve the answers submitted in the form.

Get response details action configured with the response ID from the trigger

Start document generation process

Add the Start document generation process action from the Plumsail Documents connector.

This action sends the form data to a process, generates documents from the configured template, and returns the generated files to Power Automate.

Note

For details about this action, see Start document generation process.

If you are using the connector for the first time, you will be prompted to create a connection.

Creating a Plumsail Documents connection in Power Automate

You will need to configure the connection with the following parameters:

The action requires two parameters:

  • Process name: Select the process created earlier.

  • Template data: Provide the source data in JSON format.

Start document generation process action in Power Automate

For this example, map the values returned by Get response details into a JSON object:

JSON object containing Microsoft Forms response data

The JSON object contains the values submitted through the form. Use the dynamic content picker to insert fields from the Get response details action.

Power Automate dynamic content panel showing Microsoft Forms response fields

Once configured, your process will be ready to receive the form data and generates the document.

Use the ready document in Flow

At this point, your flow is fully functional, and for many scenarios, no additional steps are required.

The generated document will look like the following:

Generated employee information document created from a Microsoft Forms submission

However, you can also use the generated document in additional Power Automate actions. For example, you can start an approval workflow and attach the resulting PDF.

Add the Create an approval action from the Approvals connector and use the file returned by Start document generation process as the attachment.

Approval workflow using the generated PDF document as an attachment

Sign up for Plumsail Documents

If you are new to Plumsail Documents, create an account and follow the steps in this article to automate document generation from Microsoft Forms submissions.