Altoura Training
Copy link
Creator

Creating Variables

A **variable** is named storage for data that persists throughout your training. Variables let you track learner choices, scores, attempt counts, and anything else you need to remember as the training progresses.

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.

Variables pane showing Score, isPlaying, and StepTitle custom variables with type badges and delete icons
Variables pane showing custom variables

The pane displays your variables in the Custom Variables section.

Creating a Variable

Variables pane showing Custom Variables (1), an expanded Score card, Type set to number, an empty Description field, and a delete icon
Expanded Score variable showing its name, Number type, and optional description

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: score is better than s or temp
  • No spaces: Use attemptCount not attempt count
  • Avoid special characters: Stick to letters, numbers, and underscores
  • Match capitalization: Variable names are case-sensitive; score and Score are 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:

VariableTypeAutomatic defaultMeaning in this example
scorenumber0No points awarded yet.
userNamestring""Empty until a value is assigned with Set Variable.
isCompletebooleanfalseTraining isn't complete yet.
attemptsnumber0No attempts recorded yet.
selectedAnswersarray[]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:

VariableTypeAutomatic defaultPurpose
scoreNumber0Running total of points earned.
questionNumber0Current question number; initialize to 1 before displaying the first question.
attemptsNumber0Number of quiz attempts started.
isQuizCompleteBooleanfalseWhether all 10 questions have been completed.
selectedAnswersArray[]Answers recorded by the training logic.
passingScoreNumber0Minimum score needed to pass; initialize to 70 before checking results.

In the starting step's On Entry actions, add two Set Variable actions:

VariableSet Value
question1
passingScore70

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 >= passingScore for the pass path; score < passingScore for the fail path.
  • Another attempt: attempts < 3 to allow a retry; attempts >= 3 when 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:

  1. In the step used to test the result, add Set Variable for score and use Set Value to enter 100. Ensure passingScore is set to 70 before the result is checked.
  2. Save the training and start Preview.
  3. Trigger the event that checks the result conditions and verify the pass path.
  4. Exit Preview, change the score's Set Value to 50, and save.
  5. Start Preview again, trigger the same event, and verify the fail path.
  6. 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:

Was this page helpful?
© 2026 Altoura
Enter a page title, topic, or keyword.