Skip to main content

How do I add a variable to a video?

Learn how to add a variable to a video in Synthesia to personalize content at scale, through the platform or the API.

Written by Jess Diaz-Gomes

✍️ Variables can only be added to templates, not regular videos. You must save your video as a template first.

To Add a Variable to Your Script

  1. Right-select in the script box to open the options menu.

  2. Select Variable.

  3. Provide a name for the variable.

  4. If necessary, set the default value.


To Add a Variable to an Avatar

  1. Select the Avatar on the canvas.

  2. Within the Inspector panel on the right hand side, select the three dots next to the Avatar settings.

  3. Select Add Variable.

  4. Provide a name for the variable.

  5. The current Avatar element will be the default value.


To Add a Variable to a Media Asset

  1. Select the media element on the canvas.

  2. Within the Inspector panel on the right hand side, select the three dots next to the media settings.

  3. Select Add Variable.

  4. Provide a name for the variable.

  5. The current media element will be the default value.


To Create a Variable for a Text Element

  1. Add a text element to the canvas.

  2. Type your variable name inside two curly brackets, for example {{variable_name}}.

  3. No default value can be set, so you will have to provide the variable value each time.


To Save Your Video as a Template

  1. Select Generate in the top right-hand side.

  2. Add a Title and Description, if needed.

  3. Select Generate, and you will be prompted to convert your video to template.

  4. Select Convert.

  5. Select Publish template.

  6. You can find your template in the Template section of Library.


💬 FAQs

What can variables be added to?

Variables can be added to the script, Avatars, images, videos, and text elements.

Can I add a variable to the voice?

It is not possible to add a variable to the voice.

Can I add a variable to show or hide an entire slide?

No. Variables work at the element level, not the slide level, so there's no way to show or hide an entire slide through a variable. If you need conditional slide content, create separate templates with different slide configurations and choose which one to use through the API.


📚 To learn more, check out the Feature Fridays: Variables recording

Did this answer your question?