Using templates

Completed

Let's take a look at the power of templates.

Word templates

Word templates provide users with a means to easily generate standardized documents about records that are rich with Microsoft Dataverse data and leverage the full formatting power of Microsoft Word. Organizational templates can be created for users to support simple document generation and users with appropriate permissions can create their own templates and share the templates with other users. A common scenario is to use a document template to handle a lightweight reporting need.

When you want to create, upload or download a template, you can do so from the admin area. However, users with the security privileges can also create them directly from the view or the form.

Screenshot of selecting the ellipses on a view or form to see template options

Word templates are generated as a specific document, from a template of the target entity. Templates are entity specific and can include data from related entities. Entity relationships are selected and brought in at the time the template is generated. Word templates are a unique reporting toolset in that one to many(1:N), many to one(N:1), and many to many (N:N) relationships can be leveraged, and lists of child records are easily displayed.

Screenshot of entity and relationship selection for creating a template

After selecting the needed relationships, the template is downloaded as a Microsoft Word file with the entity information included as xml data.

To add data fields to the template, you will need to enable the developer tab in Word so that you can access the xml data pane. To do this navigate to file-> select options and click to open the customize ribbon menu.

Screenshot showing the customize ribbon menu

Security

Permissions for templates are controlled by a user’s security role. Privileges for organizational document templates can be granted as organizational or none. Privileges for personal document templates can be given at a user or organization level or none.

By default, organizational Word templates are visible to all security roles, however access can be limited to specific security roles. Personal templates can be shared with specific users or teams by the owner of the template.

Screenshot showing a view to select security role for enablement

By creating a document with data from Dataverse, that data can now be shared with external stakeholders. Whenever exporting data, it is important to remember that the data is now leaving the security model and you no longer have control of who sees the document and its data.

Using a template

Users can use Word templates from a few different places within the user interface.

A user can use a template while viewing a record by selecting the template from the command bar of the open record.

Screenshot showing selecting a template from the command bar

You can use a template on a selected record from the entity view. Note that if you do not see templates as an option from a view, you likely do not have a record selected.

Screenshot showing the word template button from the ellipses

You can also use a Word template from a workflow. In the workflow definition, select Perform Action. From there select the SetWordTemplate item. As this uses a global action, you will need to drill into the definition to set the properties. A detailed discussion on this is beyond the scope of this course but can be found in the course for Power platform automations.

Additional Considerations

For performance reasons templates are limited to 100 related records for each relationship. For example, an account template that lists related contacts would be limited to 100 contacts, even if more related contacts exist in the system.

If you have frequent accidental edits that cause Word to freeze or degrade its performance, turn off the autocorrect options.

Lists of records created from a custom template may not appear in the same order in Word documents as the order in the apps. Records are listed in the order of the time and date they were created.

Word templates can be created in the 2013, and 2016 versions of Microsoft Word, the 2010 version of Word can be used to generate documents but not to create templates.

Word templates are not solution aware and cannot be migrated to other environments. Templates downloaded from one instance can only be used within that instance. Instance to instance migration for Word templates isn't currently supported.

Excel templates

Excel templates empower users to create up to date Excel reports without needing knowledge of Excel formulas, charts or pivot tables. Excel templates are created from a single view of Dataverse data.

Templates can be opened in Excel online or downloaded and then opened locally in Excel. Templates allow users who would usually be unable to create these reports to easily use pre-made Excel documents with current data and empowers Excel users to create reports with current data instead of maintaining their own data outside the system.

Screenshot showing a template opened in Excep

To create a template, you must first select an entity and a view. Organizational templates must use system views; personal templates may use system views or personal views.

Screenshot showing the entity and view selectors

When the template is downloaded, the current results of the chosen view will be downloaded with it. Add columns and formulas as needed for the report. Use named columns and ranges in your formulas instead of column titles or cell numbers.

Use Excel pivot chart functionality to add charts and graphs to the document. All charts and graphs should be added above the existing table so that the elements are not overwritten as the number of rows in the data table changes in the future.

Organizational templates are uploaded in the settings area under templates. Personal templates are uploaded in the entity area where the related view can be found under the excel template node in the navigation.

Note

If your Excel template does not upload in your apps when using Microsoft Edge as your browser, update Microsoft Edge and try again.

Screenshot showing the Upload Template button

Security

Permissions for templates are controlled by security role. Privileges for organizational document templates can be granted as organizational or none. Privileges for personal document templates can be given at a user or organization level or none.

Screenshot showing the Document Template and Personal Document Template lines on a security role

By default, organizational Excel templates are visible to all security roles, but access can be limited to specific security roles. Personal templates can be shared with specific users or teams by the owner of the template.

Whenever exporting data, it is important to remember that the data is now leaving the security model and you no longer have control of who sees the document and its data.

Considerations

  • Excel templates are not solution aware and cannot be migrated to other environments. Templates downloaded from one instance can only be used within that instance. Instance to instance migration for Excel templates isn't currently supported.

  • Unlike Word templates, which are generated from a specific record, Excel templates are only generated from views. You may have to remind users to go to a view to access Excel templates from the menu as this may not be intuitive to them.

  • By default, pivot chart data is not refreshed automatically. To enable automatic refresh, right click on the pivot chart, select pivot chart options and then on the data tab select the option to refresh the data when opening the file.

Email templates

Email templates provide convenient, consistent communication for users to communicate with customers, prospects, vendors, and supporters. Email templates can be used to provide a starting place for an individual email, send a quick message to many customers via a quick campaign or send mass emails with a workflow.

Templates are either tied to one entity type or global. Entity specific email templates are only available for accounts, contacts, opportunities, leads, quotes, orders, invoices, cases, contracts, service activities, and system jobs. If an email template is needed for any other entity, a global template is used. Entity-based templates are used to send an email to records of that type and have access to the fields of that entity and some related data. Global templates can be used for any entity where the entity is enabled for email.

Screenshot showing the dropdown of email template types

The title and the description of the email template are visible to users but not the email recipient. The email subject, body and any attachments will be seen by the recipient.

Screenshot showing the data fields inserted into an email template

Data fields are added to insert dynamic text into the email. Use the default text box to show what text should be used if the selected field is blank.

Screenshot showing the data field selector

Security roles manage permissions for the creation and use of email templates. Users with adequate permissions can create personal email templates and choose to share their templates with other users. Organizational templates are solution aware and can be easily transported to another environment through the solution framework.

Considerations

Emails resulting from email templates aren’t locked down, so nothing is preventing the user from editing the message before sending. In some highly regulated environments, emails may need to be created and sent via workflow to enforce branding or prevent tampering.

There is not a button to insert images or HTML code into the body of the email template, but these can be pasted into the designer from another source. An image can be hosted online and added; this image will be available as long as the website is accessible. Images and other files can also be included as attachments.

Be mindful of the lack of spell check. It can be helpful to draft your email in another application such as Microsoft Word and paste the message into the template to take advantage of spelling and grammar support. Copying from Word also allows for further text formatting options that are not available from the email template editor but are allowed if pasted from another application.

Global email templates are limited to fields from the user entity. If a standardized email is needed for a custom entity, consider using a workflow to create and send the email so that you can leverage the full data model of that entity in dynamic text.

Note

Once the email template type is selected, it cannot be changed.