Entity Template Overview | Yext Hitchhikers Platform
What You’ll Learn
In this section, you will learn:
- What is an entity template
- How to create a template
- How to populate a template
- How to apply a template
What is an Entity Template?
An entity template is a tool that allows you to apply standard content to an entity or a large group of entities in your account at the same time. Ideally, the content in entity templates is standard, applicable to many entities, and unlikely to change often. When you apply an entity template, you are only updating the fields that are included in the template – don’t worry, it won’t wipe out any of your other data!
For example, a large restaurant chain might want all of its locations in Texas to include the same marketing content (e.g., logo, tagline, promotional photos, and click-through URL). This is the perfect use case for an entity template - it ensures all entities have the standard content and makes it easier to apply that content in bulk or when new restaurants open. To start using a template, you’ll need to create, populate, and apply it to the relevant entities. We will walk through these steps below.
Properties of a Template
Before we get started on how, it’s important to understand what the properties are of a template.
Name: This is what users will see in the UI so it’s important to be as descriptive and accurate. For example, if you want to use the template to apply standard content to new locations, we recommend calling it “New Location Content”.
Language: This controls which profiles the template can be applied to so that you don’t accidentally apply Spanish content to an English profile, for example. If you select “None”, the template can be applied to any profile. If you select a specific language, you can only apply the template to profiles with that language. You will only see this option if you have the Multi-Language Profile feature turned on in your account.
API Name: This is how you would refer to the template via the API. You can change this in the future but be careful about breaking any integrations if you do.
Entity Types: Each template is applicable to one or more Entity Types. Similar to language, this helps to make sure you don’t apply a template to the wrong type of data. If you select more than one type, you will only see the intersection of fields – meaning you’ll only see the fields that both types have in common. Similar to when you bulk edit multiple types, you’ll also see an option to view the field organization based on one of the types, alphabetically, or by field type.
Fields: The most important part! When you create a template, you add fields to the template and can fill out the content for those fields just as you do on entity edit.
Creating a Template
- Navigate to Content > Configuration > Templates.
- Click the + Add Template button at the top left.
- Name your template so it’s clear which entities it applies to, e.g.,: “Texas Locations Promo Content”.
- Choose a language for your template (if all entities, select “None”, if language-specific, select the relevant language option).
- The “API Name” will autofill based on what you name the template. We recommend keeping that name, but feel free to modify it if you’d like.
- Click Add Template.
Populating a Template
In order for your template to be useful, it needs data! To add data to a template:
Start by selecting the entity types you want your template to be available for from the Select Entity Types dropdown in the top left.
- In the restaurant example, we would select “Restaurants”. If the content is applicable to multiple types, select as many as needed, but keep in mind you’ll only be able to add fields that all selected entity types share.
- In the restaurant example, we would select “Restaurants”. If the content is applicable to multiple types, select as many as needed, but keep in mind you’ll only be able to add fields that all selected entity types share.
Select your desired fields from the list to the left and populate them with the templated data.
- In the restaurant example, we would select “Logo Photo”, “Featured Message”, and “Photo Gallery”.
The template automatically saves when you save the data in your fields. If you need to make any changes later, all templates can be found in the Templates section under Content > Configuration.
You’re now ready to start applying it to entities!
You can also copy data from an existing entity when creating or updating a template. This is particularly helpful if you have a lot of fields with a lot of content that already exists on an entity in the graph. All you need to do is click on the “Copy data from an existing entity” link on the left-side bar, select the entity, select which fields to copy, and apply. This is a great starting point for a template!
Applying a Template - Entity Edit
When you apply a template, by default the data in ALL fields from the template will overwrite what is stored in those fields on the entity. So it is critical that you first make sure the entity does not have any customized content applied to it that you (or someone else) would not want overwritten by the template. That said, you can choose not to apply certain fields at all during the template application process. The ability to remove fields during application is only available in Entity Edit and the API.
Select an entity or group of entities and click More Actions then select Edit in the dropdown.
Click on the Select Action drop down on the right hand side of the screen and select Apply Template.
Select the template you’d like to apply to this entity or group of entities.
Once you’ve selected a template, a screen appears that allows you to select and unselect specific fields to apply. This is helpful if you want to apply some but not all of a template to an entity.
Once you’ve decided which fields to apply, click Apply Template and you’re all set!
Applying a Template - Entity Add
It’s really common to have templates with standard content for new entities. You can easily apply a template when you create a new entity on Entity Add.
- Navigate to Entity Add screen by clicking + Add Data from Entity Search and selecting Add Single Entity. Then select your entity type.
If you have at least one template in your account, click on the Additional Settings option at the bottom of the add entity modal, and should now see an option to apply a template by selecting the relevant template.
For the fields in the template that are visible on the add screen, you should see the content visible and editable. For the fields that are not visible on the add screen, you can click the link to “Select which fields will be applied”. From here you can see which fields will be updated and optionally unselect any fields you don’t want to apply at this time.
Continue filling out the Add Entity form as needed and submit.
You’ve now applied a template to an entity on creation!
Other Ways to Apply a Template
You can apply templates in a few other ways:
- Via Entity Upload in “Additional Actions” in the Configure File step. This will allow you to apply the template to a group of entities, like a new entity template to new entities or a ‘closed store’ template to missing entities.
- Via Saved Upload Configurations under Additional Actions. Similar to via Entity Upload, you can apply the template to a group of entities, like new or missing entities, whenever you use the saved upload configuration .
- Via the Entities API either on create or update. Similar to Entity Edit, you can choose to apply fields in the template or use a field mask to apply a subset of fields. You can learn more about this in our
developer documentation
.
You can also apply templates to future dates, which you’ll learn more about in the next module – Scheduled Updates.