Introduction: We are aware of dynamics 365 CRM’s Document template functionality. However document templates do not need XML Mapping which limit the fields that we can populate in template. SO here’s a way to use Power Automate and SharePoint and implement the Document template functionality.
- Create Word Template with content controls and Upload to SharePoint.
- Enable the Developer tab and click on Design Mode.
- From the available controls add the Content controls, repeating controls(For data table).
- Click on properties and add title, tag.
- Once done save the word and upload to SharePoint.
In you Power Automate (You can trigger the power automate as per your requirements).
- Get File Content.
- Site Address: your SharePoint link
- File Identifier: Your uploaded document template.
- Populate a Microsoft Word Template.
- Location: SharePoint Location.
- Document Library: Share Point Site Contents.
- File: Your uploaded document template.
- Content control: the content controls from your template will be visible here.
- Create file.
- File Name: Should end with .docx
- File Content: will be the populated word template.
Conclusion: Thus when your power automate runs, a Document will be created in SharePoint from the document template. It is easy to populate a Content control, to know about how to populate a repeating control- check my blog. Populate Repeating Control of Word Template using Power Automate.