In this Microsoft Tutorial, We will discuss how to create a Custom Document Template from SharePoint Online List using various templates of Microsoft Flow. Also, we will see how we can edit and save a document template in the SharePoint Online Document Library settings.
Create a Custom Document Template from SharePoint List using Microsoft Flow
For this Microsoft Flow example, I have One SharePoint Online List as “TSInfo List” and other one SharePoint Online Document Library as “TSInfo Document“.
Both SharePoint Online List and SharePoint Online Document Library are having the same data type of column with the same name which I will discuss below.
Below screenshot represents the SharePoint Online List (TSInfo List) which I have taken for this Microsoft Flow example.

This “TSInfo List” is having below different data types of columns as:
- Title (By default)
- Available Offer (Single line of text)
- Offer Description (Multiple lines of text)
- Quantity (Number)
- Price (Currency)
- Date Of Packaging (Date and Time)
- Date Of Expiry (Date and Time)

Here, Multiple lines of text work best as a Plain or Rich text in this case since Enhanced rich text passes on HTML tags to the document with the Flow. For that, you have to specify the type of text to allow as “Rich text“.

Below screenshot represents the SharePoint Online Document Library (TSInfo Document) which I have taken for this Microsoft Flow example.

This “TSInfo Document” is having below different data types of columns which is purely similar to the “TSInfo List” column.

Read Power Automate convert time zone
Edit and Save a Template URL in Document Library Settings
To create a Custom Document Template, the main and most important thing is, We just need to save the “Document Template” from “.dotx” to “.docx“.
For saving the document template, Go to “Library Settings” -> “Advanced Settings” -> “Edit Template” -> “Open it on Local MS Word application” as shown in below screenshot. Also, you can see in the below screenshot, Before editing the template URL, the URL will display as like “LibraryName/Forms/template.dotx” (Default template).
So we have to change the URL as like “LibraryName/Forms/template.docs“.

Once you will edit the template in your local MS Word application, you will see nothing will be present in that MS word document. That means the document will open with a fully blank page.
To add the Document content, Go to “Insert” -> “Quick Parts” -> “Document Property”. Once you will tap on “Document Property”, You can see all the columns which are present in that specific Document Library (“TSInfo Document”).
As per my requirement, I have added all the data type of columns which are present in the Document Library. Then I saved the template as “LibraryName/Forms/template.docs“.

After saving the Template URL, You can see the URL is changed to “.docx”. Also, you can change the template URL by itself in the “Document Template” of “Advanced Settings”.

Create Microsoft Flow to create Custom Document Template from SharePoint Online List
By using various types of Microsoft Flow templates, You can easily create a Custom Document Template, You can view the whole structure of Microsoft flow process in the below screenshot which I am going to explain you individually in below.

When an item is created or modified:
- Site Address: Provide the existing Site address URL.
- List Name: Specify the name of List where the flow will trigger when an item will create or modified. Here, I am taking my list name as “TSInfo List”.

Copy file (deprecated): This action helps to create a document in the library as a copy of the library template file as (“LibraryName/Forms/CustomTemplateName“).
- Site Address: Provide the existing Site address URL.
- Source File Path: Specify the source file path of the custom template as “/LibraryName/Forms/template.docx“. Here, my custom template name as “template“, So I have taken as template.docx.
- Destination File Path: Specify the destination file path with the name of the document to correspond the list item title and create a .docx file. The file path should be like “/LibraryName/Title.docx“. Take the “Title” field from the list (When an item is created or modified) using Dynamic content.
- Overwrite Flag: Select the flag as “Yes” from the dropdown.

Get file metadata using path:
- Site Address: Provide the existing Site address URL.
- File Path: Specify the file path as “/LibraryName/Name“. Take the “Name” from “Copy file (Deprecated)” using Dynamic content.

Update file properties:
- Site Address: Enter the existing Site address URL
- Library Name: Specify the name of the Document Library.
- Id: Take the Id from “Get file metadata using path” by using Dynamic content.
- Title: Specify the Title from the SharePoint Online list (When an item is created or modified) by using Dynamic content.
Similarly, as like title field, Take all the rest field values from the SharePoint Online list (When an item is created or modified) by using Dynamic content.

Now “Save” and “Test” the Microsoft Flow. To test the Microsoft flow, Create or modify one item in the SharePoint Online List. In the below screenshot, I have created a new item.

Once an item will create or modify in the SharePoint Online List, Then the Microsoft flow will trigger. If there is no error in the Microsoft flow, then after some time, you can see the message as “Your flow ran successfully” as like below screenshot.

Now go to your SharePoint Document Library. In that library, you can see there will be a document present which you created in the SharePoint List. Just click on the document.

Once you will click on the document, Just no need to be shocked that it is an empty document. Click on “Open in Word” option which is present on the top of the document template.

When you will open the document in your local MS Word, then you can see all the values as like below figure.

Create Versioning Settings:
In this case, one additional setting that you’d be needed to do with setting this flag as Yes is set versioning on the document library to Create major and minor (draft) versions, so that each change adds a new version to the same file.

After creating the major and minor (draft) versions, if you will go to a particular Document version history, then you can see the different type of versions as like below screenshot.

You may like following Microsoft flow tutorials:
- How to run Microsoft Flow on Schedule
- Microsoft Flow: The execution of template action ‘Switch’ failed: The result of the evaluation of ‘scope’ action expression ‘@triggerBody()?[‘ApprovalStatus’] is not valid.
- The ETag of this item does not match the one used for setting content approval status error in Microsoft Flow
- Microsoft Flow Example:Â When an item is created in SharePoint List, Send approval and create item
- Microsoft Flow Example:Â When a message is posted on a group, Create a SharePoint list item
- Microsoft Flow Example:Â Automatically create a profile for a new candidate
- Microsoft Flow Example:Â Copy new files from your PC to SharePoint Online Document Library
- Microsoft Flow Example:Â Copy Files from SharePoint to PC
- Microsoft Flow Example: Email notification after approval from a SharePoint list
- How to move files from OneDrive to SharePoint using Power Automate
- Power Automate add days to date
Hence, In this Microsoft Tutorial, We discussed how to create a Custom Document Template from SharePoint Online List using Microsoft Flow. Also, we saw how we can edit and save a document template in the SharePoint Online Document Library settings.
Also, We discussed how to create a different type of versioning (major and minor) in the SharePoint Document Library.
I am Bijay a Microsoft MVP (8 times –Â My MVP Profile) in SharePoint and have more than 15 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com
Here is a challenge!! What if your template has a header and detail. Like Sales Order and Sales Order Details. How would you iterate through the details and present the items in the documet?