Save a flag, label, or score
A Flow variable holds a value for one participant response. Use Set variable when the value is fixed or needs a simple increment. Use a JavaScript node for calculations.
Example: count correct answers
- Before the scored questions, add Set variable. Enter
scorein Variable name, choose Number, set Operation to Set, and enter0as Value. - Add an If after the question's page and configure it to match the correct answer.
- In its Then branch, add another Set variable. Enter
score, choose Number, set Operation to Increment, and enter1as Value. - Repeat the If and Increment steps for other scored questions, using the same name and Number type.
- After those questions, add an If with Condition source → Flow variable. Select
score, choose Greater than or equal to, and enter your threshold.
A participant with two correct answers has score = 2. Initializing the value in the first step gives participants with no correct answers a saved score of 0.
Types and names
| Type | Example | Operations |
|---|---|---|
| Boolean | eligible = true |
Set |
| Text | feedback_group = "standard" |
Set |
| Number | score = 3 |
Set or Increment |
Start a name with a letter, followed by letters, digits, or underscores, up to 64 characters. Names are case-sensitive: score and Score differ. Reusing a name updates the same variable; keep its type consistent throughout Flow. Choose a distinct name from your URL parameters and study values so scripts can read it unambiguously.
Read and retain the value
Later Flow conditions can compare the value or check Has been set / Has not been set. Ordinary comparisons are false while the variable is unset.
Only executed branches contribute. If participants go Back and change an answer, Flow recalculates the route and its variable values; an old increment does not accumulate simply because the page was revisited.
Completed responses include the final variables in results and CSV exports. Unset values export as blank cells. A variable derived from a private answer can reveal that answer indirectly, so apply the same care to its use and export.
