Entity templates allow you to apply a specific set of information to new or existing entities. Templates can be used to apply necessary field values in bulk.
You can use entity templates to apply standardized content to new entities when they are created, or you can bulk edit existing entities to apply template content.
Some common use cases for entity templates include:
- New entities: Create templates to add standard data to any new entities in the Knowledge Graph as soon as they’re created. For example, a “New Location” template can be used to set the logo, category, a few basic photos, hours, and other fields.
- Closed locations: Apply a template to update certain fields when a location is closed. Include fields like a “Closed” label, an updated featured message, or a redirected URL.
- Seasonal updates: Update content that changes seasonally, like business hours or promotions.
Developers can also apply entity templates when updating or creating entities using the Entities API.
View Entity Templates
On the main Entity Templates page under Knowledge Graph > Configuration > Entity Templates, there are filtering and searching tools available to help you organize and easily find your templates. From this screen, you can add, edit, or delete entity templates.
Click the search pill at the top of the Entity Templates table to search your templates based on their name, or any keywords in their description. Descriptions can be added to entity templates when they are created, or you can edit your existing entity templates to add a description later.
Create an Entity Template
- Navigate to Knowledge Graph > Configuration and click the Entity Templates tile (under the Entity Management section).
- Click the Create Template button.
- Fill out the Basic Info section of the Create Template flow.
- Enter the Template Name.
- (Optional) Select a language — if you don't, the template will be created in your account's default language.
- (Optional) Change the ID — an ID will be automatically generated from the template name.
- (Optional) Enter an internal description to explain what the template is for.
- Click Add Template.
- In the Configure Fields section, choose how you want to populate your template:
- To add fields to your entity template from scratch, click the Select Entity Type(s) dropdown menu and choose the type or types of entities you want your template to apply to.
- To copy field values from an existing entity that already has the field values you want to use, click Copy data from an existing entity.
Follow the steps in the next sections based on the method you chose to populate your template.
Add Fields From Scratch
- After selecting your entity type(s) from the dropdown, add fields to your template by clicking the checkboxes in the left sidebar.
- Click into each field and enter the field value that you want your template to apply to entities. Click Save to save each field value.
- Your template is automatically saved when you save individual field values.
- Your template is automatically saved when you save individual field values.
Copy Fields From An Existing Entity
- After selecting your entity type(s) from the dropdown, click Copy data from an existing entity. From the modal, select the entity whose field values you want to copy.
- Select the fields whose values you want to copy to your template. When finished, click Select Fields.
- Click the x icon to close the modal. You'll see the selected fields added to your template, populated with the current field values of the entity you chose to copy.
- If you want to change any of the field values, click into any field, modify the value, and click Save on the field.
- Your template is automatically saved — if you choose not to edit any field values, you can leave the screen at any time.
Edit an Entity Template
- Navigate to Knowledge Graph > Configuration and click the Entity Templates tile (under the Entity Management section).
- In the table, click the name of the template you want to edit.
- You can make the following edits:
- Update basic info. Click Save once complete.
- Add/remove fields. Select or unselect the checkboxes next to the field names. These updates will automatically be saved to the template.
- Update field values. Click into the field to update the value and then click Save once complete.
- (Optional) Delete or copy the entity template by using the buttons in the top right corner.
Copy an Entity Template
If you have an existing entity template with fields and values you want to use in another template, you can copy its exact configuration. When you copy an entity template, a new template will be created with the same field configuration for you to edit fields as needed.
- Navigate to Knowledge Graph > Configuration and click the Entity Templates tile (under the Entity Management section).
- In the table, click the name of the template you want to edit.
- Click the Copy button.
- Fill out the Template Name and ID.
- (Optional) Select a Language and add a description.
- Click Create Template Copy.
- Edit the template as needed. See the Edit an Entity Template section above.
Note: Once a template copy is created, any changes to the original template will not apply to the template copy.
Apply an Entity Template
You can apply a template to entities in the Knowledge Graph in a few different ways, including:
- Apply templates to single new entities
- Apply templates to existing entities
- Apply templates during Entity Upload
Apply a Template to a New Entity
To apply a template when creating a single new entity:
- From the Entity Search screen, click Add Data. Choose the entity type you want to add.
- After selecting your entity type, find the Templates field in the Configuration section of the Add Data modal. Select your template from the dropdown menu.
- After choosing a template, click Select which fields will be applied if you want to prevent any fields from being applied with the template.
- (Optional) De-select any fields included in the template that you do not want to apply to the new entity. When finished, click Select Fields.
- Fill out any other desired fields in the Add Data modal. When finished, click Save.
Apply a Template to Existing Entities
- Navigate to Knowledge Graph > Entities and select the entity or entities you want to apply a template to.
- From the Entity Edit view, click the Select Action dropdown and choose Apply Template.
- Select the template you wish to apply from the dropdown menu. Then, select or deselect any fields to apply using the checkboxes. When finished, click Apply Template.
- Note: only the templates that can be applied to the entity type and the language profile of the entities you are currently working with will be available to select.
- Note: only the templates that can be applied to the entity type and the language profile of the entities you are currently working with will be available to select.
Apply a Template in Entity Upload
You can also apply entity templates to entities in bulk during the Entity Upload flow.
- On the Configure File step of the upload flow, scroll to the Additional Actions section.
- Next to Apply a template to these entities, click Add Action.
- Choose your desired entity type and entity template from the dropdown menus.
- If you apply a template during the upload and save your upload configuration, the same template will be applied in future uploads using that saved upload configuration. Manage your saved upload configurations under Knowledge Graph > Configuration > Upload Configurations.