Create Excel file from SharePoint list in Power Automate flow

This article shows how to generate an Excel document from a SharePoint list item using Power Automate (Microsoft Flow) and Plumsail Documents.

When a new item is added to the list:

  • Power Automate starts a flow.

  • The list data is sent to a Plumsail Documents Process.

  • The process populates an Excel template.

  • The generated document is delivered automatically.

Content of the article:

Upload and prepare Excel document template

Before building the flow, create a process that will generate documents from an Excel template.

Open your Plumsail Documents account and create a new process.

You can either:

  • Use a premade template.

  • Start from a blank template.

  • Upload your own template.

For this example, we will use the the ready-to-go Purchase Order template.

Purchase order Excel template available in Plumsail Documents

If you are creating your own template, replace the values that should be populated dynamically with tokens enclosed in {{ }} brackets.

Excel template containing Plumsail template tokens

Then, when the document is generated, these placeholders are replaced with data from SharePoint.

Note

For more information about the templating syntax, see how XLSX templates work.

Configure output and delivery settings

After preparing the template, you can configure how the document should be generated and delivered.

Editor view highlighting the Settings option

We selected XLSX as the output format during process creation, but if you need PDF documents instead, select PDF.

You can also use template tokens in the output filename to generate unique file names automatically.

Process settings showing document format and dynamic file name configuration

Next, you can add one or more deliveries.

Deliveries determine where generated documents are sent or stored. Available options include SharePoint, Outlook, CRM systems, cloud storage services, and other integrations.

In this example, we will use an Outlook delivery to email the generated document.

Outlook delivery configured for generated documents

When configuring the delivery, you will be prompted to connect the corresponding service to your Plumsail account.

The completed Outlook delivery looks similar to the example below:

Outlook delivery settings with recipient, subject, and email body configuration

You can also use template tokens in the email recipient, subject and message body. For more information, see the delivery documentation.

Once the process is configured, continue with the SharePoint list setup.

Prepare SharePoint list

In this example, we use a list that stores purchase order information such as customer details, order items, and totals.

You can either:

  • Create a new SharePoint list manually, or

  • Use an existing list in your environment.

Each list item should contain all fields referenced by the Excel template.

SharePoint list with purchase order fields used for document generation

If you need a faster way to collect this data, you can also use Plumsail Forms for SharePoint to build a user-friendly form on top of your SharePoint list. All form submissions will automatically create list items, which can then be used later in the flow.

Note

Learn how to adjust SharePoint forms and lists with Plumsail Forms.

Make sure that all fields required by your Excel template are present in the list. Missing fields will result in empty values in the generated document.

Additionally, if your template uses nested structures (for example, product details inside our purchase order), you can use nested tokens such as {{products.Name}} or {{products.Price}}.

Nested tokens in Excel template to loop and render product details

Our templating engine is smart enough to understand what content to duplicate, and how to access properties of objects when mapping SharePoint data into the Excel template.

Populate Excel template in Power Automate flow

Now you need to create a Power Automate flow that sends SharePoint data to your Plumsail Process.

Power Automate flow, listing all used actions

The flow should start when a new list item appears, so add the When an item is created trigger from the SharePoint connector. Then, select:

  • Site Address: your SharePoint site

  • List Name: the list we created in the previous step

Next, add the Get item action from SharePoint to retrieve full details of the created list item. You need to select the same site address and list name as before, and the ID using dynamic content from the trigger

Once you have the all column values are available for mapping into the template, add the Start document generation process action from the Plumsail Documents connector.

Start document generation process action with process selection and template data field

This step sends SharePoint data to the process created earlier to generate the Excel document.

For this action you need to configure:

  • Process name: select the process we created in Plumsail

  • Template data: map all needed SharePoint fields into JSON format

Make sure that your JSON structure matches the template tokens exactly. Otherwise, values will not populate correctly.

Note

Do not use quote marks (" ") marks when using the outputs from the “Parse JSON” action into JSON format.

Once you save everything, you can test the flow:

  1. Create a SharePoint item in your list.

  2. The data is passed to the Plumsail process.

  3. The Excel document is generated automatically.

  4. The file is shared according to the delivery settings.

The final document will look like this:

Populated Excel template from SharePoint list item data

Now, you know how to instantly create Excel files with data from your favorite apps using Power Automate and Plumsail Documents.