Defining template variables
Template Variables
When referring to variables we can mean Template variables or JavaScript variables. In the context of this page, we are talking about Template variables, unless stated differently.
In the properties panel (right), choose the wrench & screwdriver tool.

Then choose Variables

A panel will appear, where you can define your template variables.
A list of all template variables that are available in the document shows
- Variable type
- Variable name
- Pencil icon (when hovering over the variable)
- "..." menu (when hovering over the variable)

Create variables from a linked datasource
If your document already has a linked datasource, you can automatically create template variables based on its field names. This speeds up Smart Template setup by generating variables in one step.
In the Data source panel, choose the option to "Create variables" from the linked datasource. GraFx Studio will create a template variable for each unique field name it finds.

After creation
Review each new variable’s type and settings (Label, Placeholder, Help text). Organize them with Group to keep complex templates manageable.
Duplicate field names
If the datasource contains duplicate field names, variables for those duplicates are not created. A toast message will show the error. Make the field names unique in your datasource and run the action again.

 
  
Options
Each template variable has a pencil icon, and three dots. The pencil icon will bring up the "Settings" panel.
The three dots will provide you below options:
Settings
Opens the settings panel
Rename
The template variable name goes into inline rename modus. You can also double click/tap on the name.
Duplicate
Creates a copy of the template variable and all its properties. Since the name must be unique, the name is appended with an incrementing number.
Delete
A confirmation dialog is shown before it's deleted.
Move to Top
Will move the template variable to the top of the list
You can also drag the template variable in the list to where you want to position it.
This location does not have any effect on the working of your document. It will only help to guide the end-user to see them in a logical order.
Move to Bottom
Will move the template variable to the bottom of the list
You can also drag it in the list to where you want to position it.
This location does not have any effect on the working of your document. It will only help to guide the end-user to see them in a logical order.
Group
You can group variables in a group or folder. This allows you to stay organised in more complex templates.
Shift-select multiple variables, and group them. After grouping, you can rename the group.


Types
Create a variable. Then, in the properties panel, choose the variable type. Different use cases demand different variable types.

Single-line Text
A placeholder for text.
See also: Text Direction
Multi-line Text
A placeholder for multi-line text.
Image
A placeholder for a reference to an image in the (GraFx) Media pool, or other sources through Connectors
Single-select list
A placeholder with a predefined list of values.
A potential use case: define a list of colors to choose from.
Boolean
A placeholder that can hold "True" or "False".
Number
A Placeholder to hold a numeric value. Different than a text variable, you can set specific elements related to numbers.
Date
A Placeholder to hold a date value. Different than a text variable, you can set specific elements related to dates.
Variable settings
Variable name

In the list of variables, you can double click or "Rename" the variable Name.
Variable name vs Display Label
The variable name is the technical name, that will be used for further automation. In the appearance tab you can set the (display) label, that will be shown in the Studio UI interface.
Default state

The default value your template variable will have.
General properties

- Type: See types above
- Required: Disabled by default
- Remove paragraph if empty: Disabled by default
 Check to remove the full paragraph this variable is used on.
 Available on (Single-line text, Multi-line text, Single-select list, Date) 
- Private data
 A set of key-value pairs to assist you with automation.
User Interface


These settings define how the template variable is presented:
- Label: Can be empty, must not be unique, by default it has the same value as the name (When the name is changed, the label is updated, unless if the label already has a different value)
- Placeholder: Default text, to help nudge the end user to fill in something
- Help text: Text that will appear below the variable to add more info what to do with the variable.
Visibility
Choose how visibility is set

- Always (default)
- Never
- Conditional
Conditional: See Visibility Conditions