Think of a variable as a container with a label. Give it a name and choose its type. Creator assigns the type's default value; use Set Variable to assign a different starting value.
Why Use Variables?
Variables enable powerful training logic:
- Track scores: Keep a running total of correct answers
- Count attempts: Limit how many times a learner can retry
- Remember choices: Store what the learner selected in a quiz
- Branching decisions: Use variable values in conditions to create different paths
- Personalization: Store the learner's name and use it in messages
Example: As the learner completes tasks, increment a correctAnswers variable. Later, in a condition, check correctAnswers >= 8 to decide the ending.
Opening the Variables Pane
The Variables pane is where you create and manage custom variables in your training. Open it from the ribbon: click Variable in Step Control. The pane slides in on the right. Click the same button again to close it.

The pane displays your variables in the Custom Variables section.
Creating a Variable

Open the Variables pane
Click Variable in Step Control on the ribbon.
Click the Add Variable button
Click Add Variable at the bottom of the pane to open the type menu.
Choose the variable type
Select String, Number, Boolean, or Array. A variable card is added with the selected type. See Variable Types for help choosing a type.
Rename the variable
Edit the name field in the card header. A rename takes effect when it is a valid, unique name; an invalid or duplicate name retains the last valid stored name. Names start with a letter or underscore and contain only letters, digits, and underscores.
Configure the variable's fields
Expand the card if needed and enter an optional Description. You can also change the Type using its dropdown.
The available fields change based on the type:
- All types: Name, Type, and Description
- String: also Pattern (Regex)
New variables start with their type's default value. Use a Set Variable action to assign a different starting value before actions that read the variable.
Fields update the working training as you edit. Use the training's Save command to persist those changes. Click the chevron in the card header to collapse the card when done.
Variable Naming Conventions
Choose clear, meaningful names for your variables. Good naming makes your training logic easier to understand and debug.
Recommendations:
- Use camelCase:
correctAnswers,userScore,isComplete(start lowercase, capitalize new words) - Be descriptive:
scoreis better thansortemp - No spaces: Use
attemptCountnotattempt count - Avoid special characters: Stick to letters, numbers, and underscores
- Match capitalization: Variable names are case-sensitive;
scoreandScoreare different names
Good examples:
userName(string)score(number)isComplete(boolean)correctAnswers(number)selectedOption(string)completedSteps(array)
Avoid:
var1,temp,x(not descriptive)Correct Answers(spaces)correct-answers(hyphens)_internal(too cryptic)
Viewing Custom Variables
In the Custom Variables section of the pane, each variable is shown as a collapsible card. The card header shows:
- The variable's name (editable inline)
- A colored type badge (string, number, boolean, or array)
- A trash icon for deleting the variable
Click anywhere on the header (other than the name input or the trash icon) to expand the card and see all of its fields. Click again to collapse it. The header also shows the count next to the section title — for example, Custom Variables (3) — so you can tell at a glance how many you've defined.
Editing a Variable
Edit fields directly in the variable card. Valid changes update the working training; use the training's Save command to persist them.
Open the Variables pane
Click Variable on the ribbon.
Expand the variable's card
Click the chevron on the variable's header (or anywhere on the header other than the name input or the trash icon).
Edit any field directly
Update the Name, Type, Description, or String Pattern (Regex). Changes update the working training; use Save to persist them.
Deleting a Variable
Open the Variables pane
Click Variable on the ribbon.
Click the trash icon on the variable's header
The variable is removed immediately. There is no separate confirmation dialog.
Variable Initialization (Default Values)
New variables start with "" for String, 0 for Number, false for Boolean, and [] for Array. Existing stored defaults are preserved when the type stays the same. The Variables pane does not expose an editable Default Value field. For a different starting value, add Set Variable in the starting step before actions or events that read it.
Examples:
| Variable | Type | Automatic default | Meaning in this example |
|---|---|---|---|
score | number | 0 | No points awarded yet. |
userName | string | "" | Empty until a value is assigned with Set Variable. |
isComplete | boolean | false | Training isn't complete yet. |
attempts | number | 0 | No attempts recorded yet. |
selectedAnswers | array | [] | No answers recorded yet. |
Review whether the automatic default suits each variable. Choose Set Value to assign a literal starting value or Set Expression to calculate one. Enter expressions directly, such as score + 10, without an assignment or {{ }}.
Example: Creating Variables for a Quiz
For a 10-question quiz scored out of 100, create the following variables:
| Variable | Type | Automatic default | Purpose |
|---|---|---|---|
score | Number | 0 | Running total of points earned. |
question | Number | 0 | Current question number; initialize to 1 before displaying the first question. |
attempts | Number | 0 | Number of quiz attempts started. |
isQuizComplete | Boolean | false | Whether all 10 questions have been completed. |
selectedAnswers | Array | [] | Answers recorded by the training logic. |
passingScore | Number | 0 | Minimum score needed to pass; initialize to 70 before checking results. |
In the starting step's On Entry actions, add two Set Variable actions:
| Variable | Set Value |
|---|---|
question | 1 |
passingScore | 70 |
Place these before actions that display or use the values. During the quiz, use Set Variable actions to record answers, update the score and counters, and mark completion.
Use Boolean expressions for transition conditions:
- Quiz result:
score >= passingScorefor the pass path;score < passingScorefor the fail path. - Another attempt:
attempts < 3to allow a retry;attempts >= 3when the attempt limit has been reached.
Choose each transition's destination step separately. A condition must evaluate to true for that transition to run. Update the values before the event that checks them; the same transition's Actions run only after its condition passes.
Testing Variables in Preview
Test the quiz conditions above using values assigned through Set Variable:
- In the step used to test the result, add Set Variable for
scoreand use Set Value to enter100. EnsurepassingScoreis set to70before the result is checked. - Save the training and start Preview.
- Trigger the event that checks the result conditions and verify the pass path.
- Exit Preview, change the score's Set Value to
50, and save. - Start Preview again, trigger the same event, and verify the fail path.
- Remove the temporary score-setting action after testing so the quiz uses its earned score.
Best Practices
Use consistent naming
Pick a convention (like camelCase) and stick with it throughout your training.
Create variables before using them
Don't start building conditions and actions that reference variables you haven't created yet. Plan your variables first.
Initialize values before use
Review the automatic defaults and use Set Variable for other starting values. Assign values before actions or events that depend on them.
Document your variables
In your training's notes or in variable descriptions, write down what each variable does and why it exists.
Use arrays for lists
Choose String, Number, or Boolean for a single value. Use Array when you need a list, such as completed steps or selected answers.
Next Steps
Learn about:
- Variable Types — Understand string, number, boolean, and array types
- Variable Interpolation — Use variables in text with
{{variableName}}syntax - Conditions — Use variables in conditions to control training flow

