How to Create a Word Document from a SharePoint list item using Power Automate?

Do you want to create a Word document from the SharePoint list item using Power Automate? This Power Automate tutorial will show us how to generate a Word document template from a SharePoint list item using Power Automate.

For example, we have a SharePoint list called Order Tracking, where we track the information related to Customer Order. This SharePoint list contains the following columns:

Column NameType
TitleSingle line of text
Customer NameSingle line of text
Shipping AddressSingle line of text
Order DateDate/Time
Product OrderedChoice [Laptop, Pendrive, Headphone]
QuantityNumber
Total AmountNumber
Payment StatusChoice [Paid, Unpaid, Declined]
Invoice NumberSingle line of text
Payment WithChouce [UPI, Cash, Card]
Payment DateDate/Time
InvoiceAttachment
generate word document from a sharepoint list item using microsoft flow

Now, when a new order is added, or the order is modified in the SharePoint list. Suppose the Payment status is paid. Then, based on the data we gave in the SharePoint list, a new Invoice will be generated in the form of a Word document.

To do this in Power Automate, we will create an Automated Cloud Flow that will trigger when a user creates or modifies the SharePoint list. Then, it checks the Payment Status is equal to paid; it will populate the Word document template and map the Sharepoint data with properties. Once it is done, we will create a Word Document in the Invoice library in SharePoint.

At last, we will convert this Word file to a PDF file and update it to the SharePoint list in the Invoice Column.

Create a Word document from a SharePoint list item using Power Automate

Here, we will create a Word document from a SharePoint list item using Power Automate without premium.

See also  Create a Task in Microsoft Planner using Power Automate

First, we will create a Word Document template in our local system, and then we will upload this file to the SharePoint library. This Word document template contains the following properties:

  • Date
  • Invoice No.
  • Customer Name
  • Address
  • Product Name
  • Quantity
  • Total Amount
  • Payment By
  • Order Date
  • Status
create document from SharePoint list using Power Automate

To add properties in the Word document, download the Word document file and follow the below steps:

  • Click on the Developer tab in the Ribbon toolbar
Create a Word document from a SharePoint list item using Power Automate

If the Developer option is not available, then click on File -> select Options -> select Customize Ribbon -> select the Developer option. Then click on OK.

create document from SharePoint list Microsoft Power Automate
  • Next, we will select the Invoice Number and then select the Plain text Content Control option like the one below:
populate word document power automate without premium
  • Once we add the Plain text content control, after the click on the Properties option. Then provide the below information:
    • Title: Provide the title of the properties.
    • Tag: Provide the tag of the properties
populate word document power automate without premium

Now, if we click on the Invoice Number, you can enter the Invoice number.

Power Automate flow create document from SharePoint list

Similarly, you can add the plain text content controller and add properties, title, and tag to the rest of the fields in the Word document.

Once you define all the properties, then upload this document to the SharePoint library. Follow the below steps to create the flow in Power Automate.

1. Open Power Automate Cloud, click the +Create icon, and select the Automated Cloud flow.

How to create word document from sharepoint list power automate

2. Then, provide the flow name and select the ‘When an item is created or modified‘ action. Click on Create.

create word document template

Now you can see the ‘When an item is created or modified’ action is added to the flow page. Then provide the below information:

  • Site address: Provide the SharePoint Site address.
  • List name: Provide the List name
microsoft flow templates

3. Next, we will check whether the Payment Status is paid or not; for this, click on +New step -> select Condition action. Then provide the below information:

  • Choose a value: Select the Payment Status from dynamic content.
  • Operator: Select “is equal to” operator
  • Choose a value: Write the value as Paid.
power automate create word document from sharepoint list

4. If the above condition is true, we will populate the Word document to map the properties values.

See also  How to Create and Delete an Item from a SharePoint List using Power Automate Desktop?

In the If Yes part of the condition, click on Add an action and select the ‘Populate a Microsoft Word document’ action. Then, provide the information below.

  • Location: Provide the location word template file
  • Document Library: Provide the document library where Word document is located
  • File: Select the file.
  • ProductName: Select the Product Ordered Value from dynamic content
  • Date: Select Payment Date from dynamic content
  • Quantity: Select Quantity from dynamic content
  • CustomerName: Select Customer Name from dynamic content
  • InvoiceNumber: Select Invoice Number from dynamic content
  • Address: Select Shipping Address from dynamic content
  • TotalAmount: Select Total Amount from dynamic content
  • PaymentBy: Select Payment with Value from dynamic content
  • OrderDate: Select Order date from dynamic content
  • Status: Select Payment Status from dynamic content
power automate create word document from sharepoint Online  list

5. Now, we will create a file in the SharePoint library called Invoices; for this, click on Add an action and select the ‘Create File’ action. Then provide the below information:

  • Site address: Select or provide the SharePoint site address
  • Folder path: Provide the folder path
  • File name: Provide the file name with the docx extension
  • File content: Select the Microsoft Word document from dynamic content
Microsoft power automate create word document from sharepoint Online  list

6. Now, we will convert the Word file to PDF; for this, click on Add an action and select the ‘Convert to pdf’ action from Encodian. Then, provide the below information.

  • File name: Provide the File name of docx file
  • File content: Provide the Microsoft Word document from dynamic content
  • PDF file name: provide the file name with .pdf extension. If you want to use the Invoice number for the file name. Then, use the below expression.
replace(triggerOutputs()?['body/InvoiceNumber'], '#', '')
Microsoft power automate create word document from sharepoint Online  list

7. At last, we will Add an attachment to the SharePoint list item; for this, click on Add an action and select Add attachment action. Then provide the below information:

  • Site Address: Select or Provide the SharePoint site address
  • List Name: Provide the list name
  • Id: Select the ID from the dynamic content
  • File Name: Select the File name -Encodian from dynamic content
  • ⁠File Content: Select the File content-Encodian from dynamic content.
power automate create word document from SharePoint Online list

8. Now save the flow and run the flow manually. Then, create an item in the SharePoint List.

See also  How to append multiple values to an array in Power Automate?
create word document from SharePoint Online list power automate

After that, you can see the flow run successfully, and you can see a Word document is created in the SharePoint library having the data from the SharePoint list.

create word document from sharepoint list power automate

Also, an attachment is added to the SharePoint list.

populate word document power automate without premium

This is how to create a Word document from a SharePoint list item using Power Automate.

Conclusion

In this Power Automate tutorial, we saw how to automatically create a Word document from a SharePoint list item using Power Automate. This is how to populate a Word document in Power Automate without premium.

You may also like:

>