Variables
A variable stores a named value. It can be a simple number, a piece of text, or a computed formula. Use variables to calculate totals, track scores, build dynamic text, or prepare data for conditions and calculations. Variables are visible to you in the editor but invisible to respondents.
Adding a variable
Type /variable and press Enter. The insert menu shows two entries:
- New variable — creates a fresh variable. Give it a name and set its value.
- Change variable — updates an existing variable. Pick a variable name from the list.
Builder mode and formula mode
Variables have two input modes — click the function icon to toggle between them:
- Builder mode (default) — a structured row with an operator picker and value control. Pick an operator, enter a value or select a field. Great for common operations.
- Formula mode — a text field where you write the formula directly with
@references. Use this for anything the builder can’t represent.
Switching between modes is lossless — your formula is preserved either way.
Operators
In builder mode, pick an operator from the dropdown:
| Operator | What it does |
|---|---|
| value | Set to any value or formula |
| add, subtract, multiply by, divide by | Basic arithmetic — click the @ button to use a field or variable as the value instead of a fixed number |
| append | Add text to the end of a text variable |
| count of | Count how many options are selected in a multiple choice field |
| max of, min of, average of | Pick multiple fields or variables and calculate the max, min, or average |
For the full syntax available in formula mode, see Formulas.
Set vs Change
When you create a new variable, the builder shows Set. When you pick an existing variable name (one that’s already defined above), it switches to Change — this is how values evolve through the form:
- Set
scoreto0 - Inside a condition
IF @answer is "correct", Changescore— add1
The Change view filters operators to match the variable’s type, so you only see relevant options.
Tips
- Position matters — a variable can only reference fields and variables above it
- Inside a skipped condition, a variable keeps its last evaluated value
- Types are inferred automatically from the value — numbers, text, or booleans
- Variables can store a boolean (true/false) result. This is useful when a complex condition needs to be reused — define it once as a variable and reference it in multiple condition blocks
- Use variables with inline calculations to show computed results to respondents