Variable Types
Variables can store different kinds of data. Altoura supports 4 variable types, each designed for a specific purpose.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)

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:| Data | Type | Why |
|---|---|---|
| A learner’s name, username | string | Text value |
| Score, points, count | number | Numeric value |
| Answer to a multiple-choice question | string | Text value (“Option A”) |
| Is something complete? Open? | boolean | Yes/no only |
| Number of attempts | number | Numeric value |
| Elapsed time (seconds) | number | Numeric value |
| List of visited states | array | Ordered list of items |
| Quiz answers for 5 questions | array | List of answers |
| Multiple scores from retries | array | List of numbers |
| A flag (audio enabled, intro watched) | boolean | Yes/no only |
Type Compatibility and Conversion
Be careful when mixing types:Default Values Matter
Every variable must have a default value. Choose defaults carefully:| Variable | Type | Default | Why |
|---|---|---|---|
score | number | 0 | No points yet |
selectedAnswer | string | "" | No answer selected |
isComplete | boolean | false | Not done |
completedSteps | array | [] | No steps completed |
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

