Create Word documents from SharePoint list in Power Automate

This article demonstrates how to create Word documents from a SharePoint list with the help of Processes in Power Automate (MS Flow).

Processes are a Plumsail Documents feature with an intuitive interface for creating documents from templates.

Let’s see how to collect data from a SharePoint list in Power Automate (Microsoft Flow) , apply the data to our template, and generate a new DOCX document.

Configure the Process

Let’s configure the Process, which will generate Word DOCX document from a SharePoint list.

Go to the Processes section in your Plumsail account.

Click on the Add process button.

add process button

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

generate Word documents from SP list

Configure a template

Once you’re done with the first step Create Process, press the Next button, and you’ll proceed to the next step – Configure Template.

It includes 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 that we’re using in this example for demonstration purposes:

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. Read this article to get familiar with the templating engine.

Test template

You can test a template as well, to see how it will look at the end. After clicking on the Test template button, you’ll need to fill in the auto-generated testing form. Fields of this form are created based on tokens from your document template. You can adjust the look of the testing form by changing token types.

test template

Once you’ve tested the template, 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 DOCX format for the output file

Configure template

Delivery

The next step is delivery. We’ll share the resulting DOCX file in a Microsoft Teams channel.

To use the delivery you need to install Plumsail Documents app for Microsoft Teams.

After that, select Microsoft Teams delivery in the list of deliveries.

Click Connect to Microsoft Teams.

Configure delivery

Once you’re connected, you will see the Teams delivery settings:

Configure delivery

Select the Team and Channel.

Start the Process

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

Create a Flow

This is how our Flow looks:

docx from sharepoint list

Check out the Flow steps described below.

Flow trigger

We need to start the Flow every time somebody creates an item in the SharePoint list. For that, search for SharePoint in Power Automate and set SharePoint-When an item is created as a trigger. You’ll need to select the SharePoint site and the List.

Flow trigger

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 two parameters:

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

  • Template data. Specify source data in JSON format:

JSON

This object contains dynamic content from the SharePoint trigger.

Dynamic content

All in all, it works this way: the flow waits when a new item is created in the SharePoint list, then it takes dynamic content from the trigger and creates a docx document.

The result looks like this:

Result

Conclusion

It’s very simple to automize creating Word DOCX documents using Microsoft Power Automate and Plumsail Documents.

Of course, it’s possible to generate more complex documents even collecting data from several lists.

If you’re new to Plumsail Documents, register an account to get a free 30-day trial.