How to
How to add a variable
A variable lets the course remember a choice, a score, or a learner detail, then use that value later in triggers and conditions.
· 2 min read
A variable is a named value the course can store and read again. Without one, every slide starts from scratch. A choice the learner made on the first slide is gone by the time they reach the last, unless something remembered it.
That memory is what lets a later slide change. A score can decide which feedback appears. A name can be written into a sentence. A true or false value can show one path and hide another. The benefit is a course that responds to the person taking it, instead of playing the same sequence for everyone.
Where to keep the value
- Show the ribbon, then open Interact and choose Variables.
- Look through Custom for values you created, or Built-in for values Aura already keeps, such as the learner name.
- Use the search box when the list is long. The Used column shows whether any trigger is reading that value yet.
- Choose New variable when you need a new one. Give it a name you will recognise later, pick Text, Number, True/False, or List, and set the starting value.
- Choose Cancel if you only opened the window to look. Choose Done when you are finished. Nothing new is stored until you create the variable.
A clear name matters more than it first seems. Triggers ask for the variable by that name, and a label such as custom_text_1 is easy to pick by mistake once the course has several of them. Name it after the thing it remembers, such as the attempt count or the chosen department.
What you gain
- Later slides can react to an earlier answer without asking the learner to repeat it.
- Built-in learner fields are already there, so you do not create a variable for the name or role unless you need a different value.
- The Used column tells you which values are still unused, so you can remove ones the course never reads.
Create the variable before you write the trigger that depends on it. The trigger can only offer values that already exist, and a missing variable is the usual reason a condition has nowhere to point.
