---
title: "Example - create a trigger"
slug: "example---create-a-trigger"
abstract: "Step-by-step guide to creating a trigger."
---
# Example - create a trigger

In this example, you create a trigger and add a variable mapping to it. Triggers let you automatically fill in template variables using metadata from a Sitecore Content Hub entity, for example *Product*, as well as frames, using assets related to that entity. Adding a variable mapping automatically fills in a template variable with a *Product* property, such as its name, and adding a frame mapping fills in a frame with an asset related to that product.

To create a trigger:

1. On the menu bar, click **Publisher** > **Templates**.
2. On the **Templates** page, click the template you want to modify.
3. On the template details page, on the **Triggers** tab, click :mdiPlus: **Trigger**.
4. In the **Trigger** dialog, in the **Source relation** drop-down list, click **Products** and then click **Add mapping**.
5. In the **Store property** drop-down list, click *Short description*.
6. In the **in template variable** drop-down list, click your desired variable.
7. Click **Save**.

For example, when you change the **Selected product** field to *Lime*, the **Slogan** automatically changes to *The best lime juice in the world:*

| Orange selected product | Lime selected product |
| --- | --- |
| ![selected product orange](https://doc.sitecore.com/api/markdown-image/ch/en/users/content-hub/images/selected_product_orange.png) | ![selected_product_lime.png](https://doc.sitecore.com/api/markdown-image/ch/en/users/content-hub/images/selected_product_limepng.png) |
| ![publication conditional product](https://doc.sitecore.com/api/markdown-image/ch/en/users/content-hub/images/publication_conditional_product.png) | ![publication conditional product change](https://doc.sitecore.com/api/markdown-image/ch/en/users/content-hub/images/publication_conditional_product_change.png) |