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:

OperatorWhat it does
valueSet to any value or formula
add, subtract, multiply by, divide byBasic arithmetic — click the @ button to use a field or variable as the value instead of a fixed number
appendAdd text to the end of a text variable
count ofCount how many options are selected in a multiple choice field
max of, min of, average ofPick 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:

  1. Set score to 0
  2. Inside a condition IF @answer is "correct", Change score — add 1

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