The 4 Variable Types
String
Text values (words, sentences, single letters)
Number
Numeric values (integers and decimals)
Boolean
True or false only
Array
A list of values (ordered collection)

The Type dropdown lets you choose from String, Number, Boolean, or Array — along with Default Value, Allowed Values, and Min/Max constraints
String
What it is: Text values — words, sentences, single characters, or any string of characters. Default value: Usually"" (empty string)
Examples:
"correct"(single word)"John Smith"(multiple words)"Safety-Procedure-001"(identifier with special characters)"The valve is open."(sentence)""(empty)
- Store the learner’s name, username, or email
- Store selected answers (“Option A”, “Door B”)
- Store status values (“open”, “closed”, “waiting”)
- Store IDs or codes
Number
What it is: Numeric values — integers (whole numbers) or decimals (numbers with a point). Default value: Usually0
Examples:
0,1,100(integers)3.14,0.5,99.99(decimals)-10(negative)
- Store scores or points
- Store attempt counts
- Store time values (in seconds or milliseconds)
- Store percentages or ratings
- Store object positions or angles
Boolean
What it is: A value that is eithertrue or false — nothing else.
Default value: Usually false or true
Examples:
true(yes, complete, open, on)false(no, incomplete, closed, off)
- Track yes/no states (is something complete? is it open?)
- Track toggles (is audio enabled? is advanced mode on?)
- Gate features (has learner watched the intro?)
- Status flags (is this section unlocked?)
Array
What it is: An ordered list of values. Each item in the list is accessed by its position (1st item, 2nd item, etc.). Default value: Usually[] (empty array) or an initial list like ["step1", "step2"]
Examples:
- Store a list of items (completed steps, selected choices)
- Store a history (previous scores, timestamps)
- Track multiple related values in order
Choosing the Right Type: Quick Reference
Use this table to decide which type to use:Type Compatibility and Conversion
Be careful when mixing types:Default Values Matter
Every variable must have a default value. Choose defaults carefully:
Defaults are important because your conditions rely on them. If a variable starts
undefined or null, some conditions might fail.
Best Practices
Pick the right type from the start
Pick the right type from the start
Changing types later can break conditions and actions. Plan ahead.
Use simple types when possible
Use simple types when possible
Strings, numbers, and booleans are easier to work with than arrays. Use them unless you really need a list.
For lists, use arrays
For lists, use arrays
Instead of
answer1, answer2, answer3, use one selectedAnswers array.Be consistent with defaults
Be consistent with defaults
Empty strings, zero, false, [] — use sensible defaults so conditions work correctly.
Next Steps
Learn about:- Creating Variables — Create variables in your training
- Variable Interpolation — Use variables in text
- Conditions — Use variables to control training flow

