Power Automate: Create Word Document with Repeating Section

Power Automate: Create Word Document with Repeating Section

Create a SharePoint list give it a name of your choice.  E.g. 

  • Name (single-line text)
  • Gender (Choice)
  • Phone Number (number)
  • Email Address (single-line text) 

Enable The Developer Tab in Microsoft Word

This is the word document template that gets populated by Power Automate. Then it gets converted into a PDF and is sent via email.

Check the developer tab and then press OK. The developer tab will now appear in the ribbon, and we can use it to create fillable fields in the Word document.

Insert A Table into the Word Document Template

Add the column headings to the first row of the table and leave the second row of the table blank.

Add Plain Text Fields to The Word Document Repeating Section

Each empty field in the second row will be populated with a text field and then we will use a repeating section to create a new row for each SharePoint list item.

 

Enable Design mode to see it. Then highlight the plain text field and select Properties.

 

Input the title and tag for the plain text field. Then press OK.

Repeat this step for each cell in the second row of the table.


Insert A Repeating Section to the Word Document Template

Highlight the entire row and select the repeating content button from the menu. We have now finished setting up the template. Save the word document template to one drive. 

Open Power Automate and build a new instant cloud flow. Name the flow Contact list flow or any name of your choice. Choose the trigger called Manually trigger a flow and click Create.

Insert a Get Items action to obtain all of the contacts information from SharePoint list items.

Add a Select action from the Data Operations actions set to transform the SharePoint list into an array with only the required columns.

Then insert a Populate a Microsoft Word template action and apply it to the Contact List Word document template. Click on the repeating section icon to change the input method.

Then apply the Output of the Select action code to the Table Rows property. This creates a new row in the Word document table for each row in the Contact List SharePoint list.

Create a file using the Microsoft Word document body.
Convert the Word Document to PDF.

Then Send an Email (V2) with the Contact List as an attachment. We are now done creating the Power Automate flow.Run the flow to generate list of contacts 

Share this Post!