Using templates

Completed

You can integrate Microsoft apps such as Word, Sharepoint, Teams with Dynamics 365 in a number of ways. Let's start by looking 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 use 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 table. Templates are table specific and can include data from related entities. Table 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 used, and lists of child records are easily displayed.

Screenshot of table and relationship selection for creating a template.

After you select the relationships needed, the template is downloaded as a Microsoft Word file with the table information included as xml data.

To add data fields to the template, you need to enable the developer tab in Word so that you can access the xml data pane. 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 you export data, it's 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 the Word Templates option on a form.

More 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 aren't solution aware and can't 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 a table and a view. Organizational templates must use system views; personal templates may use system views or personal views.

Screenshot showing the table and view selectors.

When the template is downloaded, the current result of the chosen view is 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 aren't 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 table area where the related view can be found under the excel template node in the navigation.

Note

If your Excel template doesn't 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 you export data, it's 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 aren't solution aware and can't 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 isn't refreshed automatically. To enable automatic refresh, 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 using a quick campaign, or send mass emails with a workflow.

Templates are either tied to one table type or global. Table 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 table, a global template is used. table-based templates are used to send an email to records of that type and have access to the fields of that table and some related data. Global templates can be used for any table where the table 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 are 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 secured, 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 using workflow to enforce branding or prevent tampering.

There isn't 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 is available if 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 aren't available from the email template editor but are allowed if pasted from another application.

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