Plumsail Documents lets you insert HTML and rich text into Word templates while preserving formatting. To do this, add a special token to your DOCX template and pass the HTML content to it.
The token preserves all formatting from the source HTML.
{{#html value}}
Let’s look at a simple example in the sections below.
Hint: This video uses the Classic Engine. Using the newer Modern Engine? See the sections below for updated instructions and best practices.
Rich text item and DOCX template
Let us say we have a SharePoint list item that contains rich text. The goal is to move rich text into a Word template while preserving formatting.
Â
We add a special placeholder that will process the rich text HTML data and apply it to the Word template along with all formatting. This is how it looks in the DOCX template:
Â
Power Automate flow
The flow itself is pretty simple. This is how it looks:
Â
Let us review each step of the flow.
For a selected item trigger
First, we need to find a SharePoint trigger called "For a selected item". You can click on "Instant Cloud Flow" and then "Skip". Select "SharePoint", and you will see a list of different triggers. We pick "For a selected item" as this trigger will link the flow to the selected list in SharePoint. After that, we connect to our "Documentation" site and choose the list "Company Announcements":
Â
Get item
Next, we get an item with the rich text data using the SharePoint action "Get Item":
Â
Get DOCX template
Then we download a DOCX template using default SharePoint action "Get file content". Let us rename this step to "Get DOCX template" so we can easily find it later:
Â
Create document from DOCX template
After that, we add a Plumsail action, "Create document from DOCX template". In this action, we utilize dynamic content from the previous SharePoint actions. In the "Template file" field, we insert our DOCX template we just got in the previous action. The following field, "Template Data", is an object applied to the DOCX template. In this case, we apply the column "Announcement" containing rich text from the SharePoint list. The "Document output type" field allows you to choose between PDF and DOCX formats, we'll keep the file in the DOCX format:
Â
Create file
Finally, we create a new DOCX file containing the rich text data in a SharePoint folder using the SharePoint action "Create file". In the "File Name" field, we can choose "Title" column. This is possible because we used "Get item" action in combination with the SharePoint trigger "For a selected item". Specify the file extension; in our case, we type ".docx" since we kept the Word format, but if you decide to convert to PDF, type ".pdf". In the "File Content" field, select the result file from the Plumsail "Create document from DOCX template" action.
Â
Before clicking "Save", let us give the flow a meaningful name. For example, "Create Announcement Document". Now, click "Save".
Run the flow in SharePoint
To run this flow, we need to go back to our SharePoint list, select an entry, click on "Automate", choose "Create Announcement Document" and run the flow:
Â
Now we can check our result Word file. As you can see the rich text migrated to the Word template:
Â
Get started
Hopefully, this simple example helps to start using the HTML formatter with DOCX templates.
Airtable records to multi-page documents with images: Elizabeth Bagwell Studios case
See how Elizabeth Bagwell Studios used Airtable and Plumsail Documents to generate multi-page reports from Airtable data and create image-rich appraisal documents for fine art and decorative arts work.
Elizabeth Bagwell
Owner of Elizabeth Bagwell Studios LLC
Documents
Customer Story
Mar 31
Printable document automation in Microsoft 365 at LT Corporation
See how LT Corporation replaced legacy reporting approaches with Microsoft 365 automation for printable reports, shipping documents, and operational checklists.
Jeff Phillips
Senior Director of IT at LT Corporation
Documents
Forms
Customer Story
Mar 10
Airtable forms and document generation for proposals and site reports at Northern GeoSeptic
Learn how Northern GeoSeptic reduced manual data entry by using Airtable, Make, and Plumsail for proposals and site reports.