How to Merge Word Documents in Power Automate? [Using Word – Populate Connector]

I recently worked with a client who needed a simple way to combine multiple Word documents into one. Their team created separate documents for different parts of a report, and merging them manually was taking too much time. I researched and found a solution using Power Automate premium connector Word – Populate, which we can merge with Word documents.

In this Power Automate tutorial, I will show you how to merge Word documents in Power Automate.

Merge Word Documents in Power Automate

I will use a third-party action to create this flow: Word – Populate from Encodian. To use Encodian actions, you need an API key. To get the API key, go to this link and fill out the form to activate the free trial. It will generate an API key for you.

For this example, I have two Word documents in SharePoint Folder:

merge documents power automate

To store merge documents, I created another document library. Create a Word file (template file) inside the library and add the syntax below, which will help merge the files.

<<foreach [f in files]>><<doc[f.file]>><</foreach>> 
power automate combine word documents

Now follow the below steps:

1. In Power Automate, create an Instant Cloud Flow and name it. Use the Manually Trigger a Flow trigger.

Encodian Merge Word Documents in power automate

2. Now, we need to retrieve the two Word document files. Add a Get file (properties only) action and provide the following parameters:

  • Site Address: Select the SharePoint site address.
  • Library Name: Select the library name from the drop-down menu.
  • Limit Entries To Folder: Select the folder.
power automate merge word document

3. Now add the Initialize variable action, then provide the below parameters:

  • Name: Provide the name as varContent.
  • Type: select the type as String.
  • Value: provide the value as below syntax:
{
"files": [
power automate document merge

4. Add Get file content action, then provide the below parameters:

  • Site Address: Select the site address.
  • File Identifier: Select the Identifier from the dynamic content of the Get file (properties only).

It will automatically add Apply to each action.

merge word documents power automate

5. Inside the for each add Append to string variable action, then provide the below parameters:

  • Name: Select the Name as varContent
  • Value: Provide the value as below code:
{
   "file": "@{body('Get_file_content')?['body']}" 
},
merge sharepoint list to word document using Power automate

6. Outside of for each action, add Append to string variable action, then provide the below parameters:

  • Name: Select the Name as varContent
  • Value: Provide the value as below code:
 ] 
}
encodian populate word document

7. Add Get file content action, then provide the below parameters:

  • Site Address: Select the site address.
  • File Identifier: Select the template file by clicking on the Folder icon.
how to merge word documents using Power Automate

8. Now we will merge the content, so add Word – Populate, then provide the below parameters:

  • File content: Select the File content dynamic content from the Get file content action.
  • Document Data: Select the variable from the dynamic content.
how to merge files in word using Power Automate

9. Now add the Create file action and provide the below parameters:

How to Merge Word Documents in Power Automate

Now save and run the flow. Once your flow runs successfully, go to the library and open the final Word file. You will see that the content has been merged.

Merge Word Documents in Power Automate

Conclusion

In this tutorial, I showed you how to merge multiple Word documents into one using Power Automate. We used the Encodian “Word – Populate” action to pull the content from two Word files stored in SharePoint and combine them into a single document.

>

Build a High-Performance Project Management Site in SharePoint Online

User registration Power Apps canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App

Power Platform Tutorial FREE PDF Download

FREE Power Platform Tutorial PDF

Download 135 Pages FREE PDF on Microsoft Power Platform Tutorial. Learn Now…