{{variableName}}
Before using the examples, create the referenced variables in the Variables pane. Use Set Variable actions to assign their values before the display action: choose Set Value for a literal value or Set Expression for a calculation. Enter Set Expression formulas without {{ }}.
In the examples, Variable: score = 95 describes the value to assign. Select score in Set Variable and enter 95 as its value; do not enter the entire assignment as an expression. Display text examples use the Body field unless Title is specified.
Basic Syntax
{{userName}}is replaced with the value of theuserNamevariable{{score}}is replaced with the value of thescorevariable
- If
userName = "John"andscore = 95 - The text becomes:
"Hello John, you scored 95 points."
Common Uses
Interpolation is supported in the Title and Body fields of Show Text and Show Panel. Verify other fields in the target client before relying on it there. Here are the most common uses:Show Text Action
Show Panel Title and Body
Feedback Messages
All Variable Types
Interpolation works with all variable types:String Variables
Number Variables
Boolean Variables
Array Variables
{{completedSteps}} displays Read Instructions,Identify Valve,Turn Valve. Use len() when you need the item count.
To display one item, use its index in square brackets. Indexing starts at 0, so scores[0] is the first item and scores[1] is the second:
Advanced: Using Expressions in Interpolation
In addition to simple variable names, you can use Altoura Expression Language (AXL) expressions inside{{ }}. Interpolation reads values and computes display text without changing stored variables. Use Set Variable to save a calculated result.
Ternary Expressions (If-Then-Else)
condition ? valueIfTrue : valueIfFalse
Another example:
Arithmetic
Function Calls
For example, check whether a step is in a list:
filter, put the predicate in quotes. Within it, item is the current element and index is its position, starting at 0. The predicate can reference other variables and must return true or false. JavaScript arrow functions are not supported.
concat or filter in display text leaves the original array unchanged. To update a list, select the array in Set Variable and use Set Expression, such as concat(completedSteps, ['step3']).
String Concatenation
Undefined Variables: Default Behavior
What happens if you try to interpolate a variable that doesn’t exist or is uninitialized?--. An existing empty String displays as empty text. An expression evaluation failure displays [Error].
To avoid this:
- Create variables before referencing them and use Set Variable for the values the text needs.
- For an existing String variable, use a ternary expression to provide fallback text when its value is empty:
userName before using it.
Real-World Examples
Quiz Feedback
score, maxScore, and userName first. Then select the String variable feedbackLevel in Set Variable and use Set Expression with score >= 80 ? 'great' : 'okay' before the display action.
Personalized Status Message
Time-Based Messaging
Conditional Content
passScore and actualScore first, then calculate the String variable feedbackURL with Set Expression before displaying it.
Where Interpolation Works
Interpolation is available in:
Where it doesn’t work:
- Variable names and fields in the Variables pane
- Condition expressions and Set Expression formulas (use variables directly, without
{{ }})
Testing Interpolation
Use Set Variable actions before the display action, then save and start Preview to check the resulting text.- Create a String variable named
userName. - Add Set Variable before Show Text. Select
userNameand use Set Value to enterAlice. - Set Show Text’s Body to
Hello {{userName}}, welcome!. - Save and start Preview. Confirm that the text reads
Hello Alice, welcome!. - Exit Preview, change the Set Variable value to
Bob, and save. - Start Preview again and confirm that the text reads
Hello Bob, welcome!.
The Variables pane manages variable definitions; it is not a live runtime-value editor. Set starting values through Set Variable actions and restart Preview to test edits.
Best Practices
Keep interpolation readable
Keep interpolation readable
Avoid overly complex expressions in
{{ }}. If it’s hard to read, it’s hard to maintain. Consider breaking complex logic into separate variables.Always initialize variables
Always initialize variables
Create each variable and use Set Variable to assign the value your text needs before displaying it. A new String starts empty; use a ternary expression when empty text needs a friendly fallback.
Use ternary for conditional text
Use ternary for conditional text
Use a ternary expression such as
{{score >= 80 ? 'Passed' : 'Try again'}} to choose the text displayed by one action.Be consistent with variable names
Be consistent with variable names
If you use
userName in some places and learnerName elsewhere, you’ll confuse yourself. Pick a naming convention and stick with it.Test with real data
Test with real data
Preview your training with actual variable values to make sure the interpolated text looks good and reads naturally.
Use friendly text
Use friendly text
Even if
score = 92, consider displaying “Great job!” instead of just the number. Use ternary expressions to show friendly feedback.Common Mistakes
Next Steps
Learn more about:- Creating Variables — Set up the variables you interpolate
- Variable Types — Understand string, number, boolean, and array types
- Conditions — Use variables to control training flow (not interpolation)

