Table of Contents
Metadata templates are a collection of fieldsets and custom fields, similar to custom metadata but with additional features and a new interface.
The addition is that fields have a SoQL expression associated with them which allows a site administrator to define custom validation. Before validation was limited to required fields or optional fields, now validation can take on any form you can express in a SoQL expression.
NOTE: Metadata templates do not change how metadata is stored, used, or rendered on the platform. Metadata templates will also not delete any existing metadata that has already been configured on a domain. Find more information on the new feature here Metadata Templates
How to Get Started
To access metadata templates, a roled user with the required permissions, e.g an Administrator will navigate to the Metadata page within the Administration Panel on your domain.
The new metadata templates page will have a different UI with three main sections including a new section labeled Audit Metadata as shown below:
With Metadata Templates, Categories are still set up the same way as in the old workflow, the main difference is a more user-friendly interface, that makes it easier to add, delete and manage new and existing categories.
Existing categories will be listed as shown in the screenshot below. Users will have the ability to hide/unhide them from the catalog and delete them if needed.
To add a new Category
1. Enter the new category name
2. If adding a secondary category, select a parent category from the dropdown.
3. Click on Save.
4. The new category will be hidden from the catalog by default. To unhide it, click on the checkbox for the category under Shown on the grid
NOTE: All category names have to be unique. Attempting to duplicate a category will result in the following error
The UI for metadata templates re-uses the patterns from VQE (Exploration Canvas) to render certain SoQL expressions as easy-to-use UI components. Similarly, there are UI components that generate SoQL expressions without having to write SoQL.
Let's use an example scenario to go over the new features and workflow for adding and managing field sets and fields:
For example, to add a Field set labeled 'Test Field Set' with a Field labeled 'Test Field'
1. Click on the Add Field Set button, type in a field set label and click on Save
2. Click on Add Field and type in the fields name.
3. Once added, selecting the added field will show more options as shown below.
4. By just adding a field a SoQL query is generated automatically. To view the query, click on the blue Edit SoQL validation button.
Custom SoQL expressions
The SoQL expression editor associated with each field is accessible at the top right of the field manager. Admins are free to define whatever expression they see fit for the metadata field. The constraints are the same as data transformations, as in, it produces a single value. The "columns" available to reference are the metadata input fields they have defined.
It works in the same way as data transformations, with the same functions available. The documentation is available below the editor, just as it is in DSMP.
Any selected options will be added to the query. e.g the "Make this a required field" checkbox will modify the SoQL query that makes the expression required or not, as shown below:
The metadata audit tool allows an admin to run metadata validation against existing assets. It uses the common catalog components to display and interact with the list of assets on the domain.
Clicking on the link in the Metadata Status column opens a modal which displays the error messages produced by the SoQL expression.