logo
DocumentsSharePointPower Automate
Sep 08

How to export multiple SharePoint list items to one Word document

Customer Support Engineer

Turning a single SharePoint list item into a document is fairly straightforward. The challenge starts when you want to pull multiple SharePoint list items, filter them, and display them together in one document.

I'm trying to create a scheduled flow to export items from my SharePoint list into a Word document ... I read something about composing but I'm not quite sure how I can apply it here. Can someone please list out the steps for the flow that I should build?
Power Platform Community user
I want to setup a Flow (recurring) that aggregates all of the list items for the current week and sends them in an email ... I'm having a little trouble wrapping my head around how to do this. Any suggestions?
Power Platform Community user
 

In this article, we'll show you how to use Power Automate and Plumsail Documents to collect multiple SharePoint items and images, pass them to a Word DOCX template, and generate a single report.

By the end, you'll have a flow that can automatically generate a weekly report like this:

Weekly team activity report generated from SharePoint list items  

Set up the SharePoint list for the weekly report

We'll start our example with a SharePoint list that contains our team's activities. Each item represents one activity and includes fields such as:

  • Activity
  • Status
  • Owner
  • Deadline
  • Notes
  • Photo

SharePoint list containing team activities, status, owner, deadline, notes, and photo  

As you can see, the columns don't all have to be simple text fields. For example, Status can be a Choice column, Owner can be a Person column, and Photo can be an Image column.

This last case can be useful when you need to associate one image with each item. However, if you need to store several files or images for an activity, you should consider using an attachments column instead.

Once the list is ready, we can create the Word template that will turn these items into a report.

Create the Word template with a repeating table

In the Plumsail portal, create a new process and upload your template. You can also download the template used in this example and use it to follow along.

Create a new process in Plumsail by updating a template  

Once the template opens in the editor, you'll see the fields that will be populated with data from SharePoint:

Word template with SharePoint fields for a weekly activity report  

The values inside curly brackets {{ }} are tokens. When Power Automate sends the data to the process, these tokens are replaced with the corresponding values.

You can also use object operations to format the data before it appears in the document. In our example:

The most important part of the template is the table. Because we want to include several activities in the same document, the table will work as a repeating table. Each SharePoint item becomes one row, so the resulting document contains all activities together rather than generating a separate document for every item.

At this point, you can also choose to generate the final file as a PDF. Open the template settings and change the output format if needed:

Plumsail Documents template settings for selecting the document output file type  

Save the template when you're ready, then move to Power Automate.

Get SharePoint list items for the reporting period in Power Automate

Now let's build the flow that will collect the data and send it to our Word template.

The complete flow will look similar to this:

Complete Power Automate flow that retrieves SharePoint items and generates a weekly report  

We'll go through each part step by step.

Because we're creating a weekly report, we'll start with a Recurrence trigger. In this example, the flow runs every Monday at 7:00 AM.

Power Automate recurrence trigger configured to run the report every Monday  

Next, initialize an Activities variable with Array type. We'll use it to collect the SharePoint items before sending them to the document generation process.

Power Automate array variable used to store SharePoint activities  

From the SharePoint connector, add a Get items action. Select the site and the list where your activities are stored.

Power Automate SharePoint Get items action with a date filter for the reporting period  

This action can return all items from the list, but you probably don't want every activity in a weekly report. You can use the Filter Query field to retrieve only the items that belong to the reporting period.

For example, the following filter and expression retrieves items modified during the last seven days: Modified ge '@{addDays(utcNow(), -7, 'yyyy-MM-dd')}'

You can adjust the filter to match your reporting requirements. For example, to retrieve activities with a deadline within the next seven days, you could use: Deadline ge '@{utcNow()}' and Deadline le '@{addDays(utcNow(), 7, 'yyyy-MM-dd')}'

Once the items are retrieved, we can prepare their data for the Word template.

Add SharePoint images to the repeating table

If your report includes images, there is one additional step to retrieve their content.

We won't go into all the details here, as we have a dedicated guide covering how to work with SharePoint images in Power Automate.

For this example, start by adding the Get attachments action. Select your SharePoint site and activity list, then use the ID from Get items. Power Automate will automatically create an Apply to each loop for the returned items.

Power Automate Get attachments action retrieving files from a SharePoint activity  

Inside the loop, add Get file content. Select your SharePoint site again and use the following expression as the File Identifier: first(outputs('Get_attachments')?['body'])?['Id']

Power Automate Get file content action retrieving a SharePoint image  

This retrieves the first attachment associated with the item. In our example, we're only expecting one photo from the column we created, so this is enough, but if your items have multiple attachments, you'll need to identify the image you want to retrieve, for example by checking its file name or extension.

Now we can build the object that will represent each activity and append it to the Activities array.

Power Automate actions building an activity object with an image  

For the Photo value, use: body('Get_file_content')?['$content']

This expression passes the actual file content to the template so that Plumsail Documents can render the image.

Pass multiple SharePoint list items to the Word template

At this point, the Activities array contains the SharePoint items we want to include in our report. Now it's time to send them to the template.

Add the Start document generation process with json action from the Plumsail Documents connector. Select the process you created earlier and pass the Activities variable as the template data.

You can also include other values, such as the report date.

Power Automate Start document generation process with JSON action passing the activities array to a Word template  

When the process receives the array, the table in the template will populate each item and create a new row.

This is the key to putting multiple SharePoint items in one Word document: instead of starting a document generation process for every list item, you collect the items into an array and pass the whole collection to the template.

Save the flow and run a test. Check that the expected items are included, that your date filters work correctly, and that images appear as expected.

Generate the weekly Word or PDF report

Once the flow is working, you can decide where the generated report should go. For example, you might want to:

  • Email the report to a manager.
  • Save it in some storage service.
  • Use the generated file as input for another Power Automate action.

You can configure all these integrations and more using a delivery option in your Plumsail Documents process. For example, we will store the resulting report in a SharePoint document library:

Plumsail Documents delivery option configured to store the generated report in a SharePoint document library  

Multiple delivery options can be used if the same report needs to be sent or stored in several places.

Other ways to use multiple SharePoint items in one document

A weekly activity report is just one example of what you can do with this approach. The same Power Automate SharePoint list to PDF workflow can be replicated to create:

  • Project status reports
  • Sales reports
  • Newsletter digests
  • Product lists
  • Invoices and order summaries with multiple line items
  • Customer or employee reports
  • Meeting summaries

And although Word is a natural choice for reports, you can use repeating data with Excel and PowerPoint templates as well.

Conclusion

Power Automate makes it easy to retrieve SharePoint list items, but the real flexibility comes from deciding how to use those items later.

By storing the results into an array and passing them to your Plumsail Documents template, you can turn multiple SharePoint list items into one final document instead of generating a separate file for every record. And once the basic flow is in place, you can complement it with filters, images, additional calculations, delivery options, and different layouts.

This makes it a practical way to generate a report from a SharePoint list automatically, whether you need a weekly team report, a project summary, or another repeating document.