Create a dynamic Word template
You can create a Word template in Power Apps from two different areas:
Advanced settings - Using this requires specific permissions that are available through the System Administrator or System Customizer security roles.
From a specific record - When the record is open (main form) or selected in a list (view), those templates are available only for the user who created them. These are called personal templates.
This module focuses on personal templates.
Create a dynamic Word template
To create a Word template based on Dataverse, follow these steps:
Play a model-driven app, select a view of the target table, and then select a specific record from the table by clicking on and selecting the row. Find and select the Word Templates dropdown menu from the Command Bar across the top, and select Download Template. Depending on your browser's window width, you may need to first select on the ellipses in the top Command Bar to find and select Word Templates.
In the displayed form, either confirm the pre-selected table or select another table (entity), and indicate if any related records are needed in the template (by using the different relationship options). Select Download to proceed to the next step.
Open the generated Word template. (It was downloaded onto your local computer, wherever your downloads are saved.) Check the Ribbon across the top for the Developer tab. If the Developer tab isn't in the Ribbon, enable this option from File > Options. Select Customize Ribbon, enable Developer, and then select OK to confirm.
Define which fields are available for the template. To do so, select XML Mapping Pane from the Developer menu. Select the Custom XML Part that starts with urn:microsoft-crm/document-template/.
On the XML Mapping pane, right-click each field to add to the document. For each added field, select the field type from the Insert Content Control menu. Available field types are Rich Text, Plain Text, Picture, Checkbox, Combo Box, Dropdown List, or Date picker.
Select, position, and format the fields within the document. A document might resemble the following screenshot.
Once the formatted template is ready to be used, save it. Next, upload the saved version to the model-driven app by navigating to the same table view that you previously used to download the Word template. Once in the correct view, select a specific record. Then from the Word Templates dropdown menu, select Upload Template.
A form will pop up; in the form, select Choose File, select the saved template, and then select Upload to proceed.
The template is now available to use for any record you select in the table. (You are not limited to using the template with only the record that you selected to generate the template originally.) To generate a new document for a record using the template, select a record, select the Word templates dropdown menu, and then select the template under the Personal Word Templates section. You can select multiple records, and you will generate a separate document from the template for each selected record.
The generated document that's uploaded to your local computer is based on the template, but it is populated with the relevant information from the selected record. The following screenshot shows an example of a generated document.
Next steps
Now, you've learned how to create a Word template that uses Dataverse as a data source to generate standardized documents. Next, you'll learn how to create a work order template.