Introduction
This article demonstrates how to create a table inside a word file using power automate, SharePoint List, and SharePoint Document Library and save created word files inside SharePoint Document Library. Sometimes we have a requirement to print SharePoint List data or any other data inside the table in a word file. We can archive this requirement using power automate, Word templates, and SharePoint lists also we need a document library for store word templates.
Prerequisite
- Power Automate
- SharePoint List
- SharePoint Document Library
I divide this article into two-part,
- Create Word Template
- Create Power Automate Flow
Create Word Template
Steps to Create Word Template,
Step 1
Open Word then add a two-row table and add a column according to your requirement, I have selected a two-row and three-column table.
Step 2
Add a heading to your table in the first row
Step 3
Got to DEVELOPER tab in the word.
If you don't see the Developer tab then visit this link to display the DEVELOPER tab.
Step 4
Add Plain Text Content Control from the DEVELOPER tab for each column.
Step 5
Change Property of the Control from Control Property Button, first Select Your Control and click on the Property button inside the DEVELOPER tab.
Step 6
Once you click on the Properties button below popup will be open, in this window add Title and Tag then click on the ok button. Repeat these steps for all control.
Step 7
Select the entire row which contains Plain Text content Control and click on the Repeating Section Content Control from the DEVELOPER tab.
Step 8
Once you click, Repeating Section Content Control will be added.
Step 9
Select Repeating Section Content and set the property of the control, same as step 5.
Step 10
Save the Document and upload it to the SharePoint Document Library, which I have created already so I upload the template inside that.
Create Power Automate Flow
Steps to Create Flow,
Step 1
Open Power Automate.
Step 2
Select the “Create” option from the Left Navigation Panel and then select “Instant cloud flow”. (You can select any time as per your requirement).
Step 3
Once you select the above option a dialog box will open. Enter details and click on the “Create” Button.
Flow Name - Enter the name of your flow
Choose your flow’s trigger based on your requirement. Choose a trigger from the list.
Step 4
Once you click on to create your flow page opens with your action.
Step 5
Click on “New Step”.
Step 6
Add “Get items” action.
Step 7
Once the action is added, select your site and List name.
Step 8
Add New Action “Select”.
Step 9
In From Select Value of ”Get Items”.
Step 10
In Map enter the same Key as we set in documents template Plain Text control Title, and for value select your list fields.
Step 11
Add “Populate a Microsoft Word template” action.
Step 11
Select your site and template from the document library where you upload the template.
Step 12
Click on “Switch to input entire array”.
Step 13
Select “Output” of Select action.
Step 14
Add “Create file” action of the SharePoint, select site and document library where you want to create the file, select “Microsoft Word document” in File Content.
Step 15
Save your flow and test.
OutPut
Summary
In this article, I discussed how we can create a word document template in word, and how we can create power automation for the print tables inside word files in SharePoint, also we saw how to save document files inside the document library using power automate.