How do I show a variable's value in text?

While editing text, choose Insert › Variable or type % and pick the variable. The slide shows its name; learners see its current value.

Last updated

A variable's value can appear inside text, for example "You planned 3 breaks". On the slide you see the variable's name, so you know what goes there; in Preview and the published course, learners see its current value.

Insert a variable

  1. #

    Double-click the text on the slide, or select the object and press Enter or F2. This works in text blocks on a scrolling page too, and in a question's Prompt field.

  2. #

    Put the caret where the value belongs.

  3. #

    Choose Insert › Variable, or find it with command search. A list opens with each variable's type and starting value.

  4. #

    Type to narrow the list, then press Enter or click the variable.

Insert › Variable works only while you are editing text. When no text is being edited, it says Click into text first.

Or type a percent sign

  1. #

    While editing, type % at the start of the text or after a space. The same list opens.

  2. #

    Keep typing to narrow it: %Bre finds BreaksPlanned.

  3. #

    Press Enter or Tab to insert the highlighted variable. Press Escape to close the list and keep the % you typed.

A % straight after a number, as in 50%, stays plain text and never opens the list.

Make a new variable as you go

  1. #

    Choose New variable… at the end of the list.

  2. #

    Give it a name, a type and a starting value. Names use letters, digits and underscores, and start with a letter.

  3. #

    Confirm. The variable is added and inserted in one step, so one Undo removes both.

What you see on the slide

  • A reference shows as a chip with the variable's name, while you edit and afterwards. Screen readers hear it as "variable" and the name.
  • The caret moves around a chip as one unit. Backspace or Delete next to a chip removes the whole reference.
  • In text fields, such as a question prompt, the reference reads %Name%.

Fix a missing variable

A %Name% that names no variable stays exactly as you typed it.

  • On the slide it shows as an amber, dashed chip marked as a missing variable.
  • A text field says References a variable that doesn't exist, with a suggestion when a name is close.
  • The import report lists it under Text that names a missing variable.

Xogogy never changes the name for you. Fix the spelling, or create the variable.

Check it

  1. #

    Choose Preview and do what changes the variable, such as clicking a button.

  2. #

    Watch the text update. Live variables in the Preview side panel shows every value as it changes.

Tip: A variable reference keeps its own formatting. Make the value bold or a different colour like any other words.

References follow the variable itself, so renaming the variable later does not break the text.

Still stuck?

Write to support@xogogy.com. A person at GForce Learning reads every message. Include the app version from Help › About Xogogy.