In this post I will explain how to use SharePoint list as data source and populate a template word document based on a collection of items. That is to essentially extract some data, populate nicely into a word document.
This newly created word document to be stored in a customer specific folder in a SharePoint Document Library. The word document will then need to be converted into a PDF.
Considering the design principles such as re usability, allowing for that logic to be simply plugged into other services (if required based on different use cases), Power Automate is the best candidate to achieve this functionality.
Power Automate helps you to streamline your business process by using different connectors.
In this scenario, I will explain how to use the Word Connector in Power Automate which helps you to generate an invoice document. Then use Convert Word document to PDF to generate a PDF file for your invoice.
You should have following things ready:
- Create a SharePoint list to manage list items (in this case I am using “Quote” as list)
- Create a document library to store Template document (in this case I am using “Quote Template” document library)
- Create a document library to store converted (Word and PDF) documents (in this case I am using “QuoteFiles” document library)
- Create a word template with the placeholder to replace with list items
- Save it and store at #2 (Template document library) (I have already created a template for this scenario)
5. Create a Power Automate on list from where we will trigger the workflow
Following image depict the actions used in Power Automate which will initiate the process when an item is created.
This Power Automate will convert the list item into Word document (It will replace the list item value with the place holders used in template document) and then convert into PDF file and upload the converted PDF file into document library. Also notify the person who has created this invoice item in SharePoint list.
Hope this helps!!!