Why Variable Names And Recodes Matter
Analysis-ready survey data depends on readable variable names and stable coding. Before launching an academic research survey, decide how each key question should appear in exports and how answer options should be represented in analysis.
Variable naming is easiest while you are still in Block Builder. Name the question before using it in Flow, quotas, random assignment, codebooks, API pulls, or analysis scripts.
Block Builder: Variable Name
Name A Question In Block Builder
Step 1: Open the question card. In Block Builder, select the question that will appear in analysis, Flow, quotas, or a codebook.
Step 1: Open the question card
Step 2: Fill in Question Name. Use a short stable name, such as party_id, age, treatment_check, or trust_media.
Step 2: Fill in Question Name
Step 3: Add recodes where available. For closed options, enter stable numeric or text recodes before publishing.
Step 3: Add recodes where available
Step 4: Preview and submit a test response. Use Preview to make sure the respondent-facing label still reads naturally.
Step 4: Preview and submit a test response
Step 5: Open Export. Confirm the exported header and values match the codebook before live data collection.
Step 5: Open Export
Name Questions For Analysis
Use short, descriptive question names for variables that will appear in models, branching, quota logic, or codebooks. Names such as party_id, age, treatment_check, or trust_media are easier to analyze than long prompt text.
- Prefer lowercase with underscores:
policy_supportis easier to use in scripts than a sentence-length prompt. - Include the construct, not the wording:
trust_courtcan survive a wording edit better thanagree_courts_are_fair. - Keep waves or arms explicit: use names such as
w2_incomeorpost_trust_mediawhen timing matters. - Avoid vague labels: names like
question_1,score, andresponsebecome hard to audit in exports.
Export: Variable Names in Output
Use Recodes For Stable Values
Recodes let researchers keep exported values stable even if display labels are longer or more participant-friendly. They are especially useful for Multiple Choice, Grid Matrix, Conjoint, and Ranking questions.
- Ordered scales: use numeric recodes in the same direction across the battery.
- Nominal categories: use stable text or numeric codes that will not change when labels are edited for readability.
- Missing-like answers: document Prefer not to answer, Don't know, Other, and skipped values separately.
- Experimental arms: choose condition codes that analysts can understand without seeing the full treatment text.
Block Builder: Multiple Choice (Recodes)
Selective Adding Variables
When you need totals across several questions rather than a coded interaction of their answer combinations, use a Selective Adding variable in Flow → Variables. It does not build the cartesian answer table that an Extra Recode multi-source interaction does.
- Count Value Occurrences: pick source questions and/or other Flow variables (including multi-select questions). Each distinct answer value gets its own export column and pipe path as
name.value. For example, if questions answer tree, orange, and tree+orange, a variable namedvaryieldsvar.tree = 2andvar.orange = 2. - Highest Value Count: uses the same counting rules, but stores one label — whichever value appeared most often across the sources. A comma-delimited value from a combined source, such as
apple, pear, contributes one count toappleand one topear; it is not treated as a third value. When counts tie, set Tie-Break Order in Flow (comma-separated answer labels; first listed wins). Leave it blank to fall back to source option order. When the sources have a known option list, branching on this variable uses those labels as one variable's discrete options, not an interaction between the variable and each value. Direct values with custom recodes can be used as sources, and their mapped labels are preserved in live links. Runtime recodes are resolved before a dependent combined value is used for branching, in both Preview and live links. Pipe and export it like any other single variable (for example{{var:top_fruit}}). - Sum Numeric Values: add numeric answers (or numeric variable values) across the sources into one total — sliders, number fields, Constant Sum totals, choice questions with numeric recodes, and numeric Flow variables.
Add a combined value from the Values section and choose Combined answers. You can include as many sources as you need — combined values do not use the four-source cap that recode interactions do. Sources used inside another combined value must resolve to one scalar value; count-column outputs and Python/R script values cannot be used as scalar sources. Pipe per-value count columns with {{var:name.value}} (for example {{var:fruit.tree}}).
The Flow panel now calls these named outputs Values. Select Add Value and choose whether to create a value from a question, recoded answers, combined answers, or a random draw. Use Import from code for Python or R assignments. Python and R recodes support a returned value, a final expression, or a result assignment; a script that rewrites its source answer is also captured. Dependent values can address each recode by its stable value ID or its name. New values open immediately, and each card shows whether its name and source are ready, whether it is used in branching, and which kind of value it creates. The summary at the top points to values that need attention, and Duplicate value copies a configured value with a fresh name so you can reuse a setup safely.
In the Preview tab, the Live variables panel stays pinned beside the respondent view on larger screens, scrolling on its own when the list is longer than the window, and follows the survey on smaller screens. It updates as answers, question scripts, combined values, and Python/R recodes resolve, so you can inspect the current value without scrolling back to the top. Each variable has a small status dot: green means resolved, solid blue means it is waiting, pale blue means it has not produced a value yet, and red means a recode error occurred. Hover over a dot for its explanation. If a Python or R recode cannot run, a notice at the top of the panel says whether the code runner was unavailable or the script raised an error, and the affected values read Couldn't run.
Recodes built from the recode table — one question's options mapped to values, or an interaction grid across two to four questions — are calculated directly in the survey as respondents answer, so they update instantly and do not depend on the code runner. Once you edit a recode's Python under advanced controls or write it in R, it runs as a script instead.
To route respondents from a value, open its card and select Create branch. The linked branch can be opened from the card, synchronized when the value's known options change, or unlinked while keeping its canvas paths. If the source options change later, the card shows Needs sync and the top summary points to it. Deleting a value first shows the branches, combined values, quotas, or permutation sets that depend on it.
Best Practices
- Use consistent naming conventions across related surveys, study waves, and library blocks.
- Keep recodes stable after publishing, and document any mid-field change in the codebook.
- Document missing values such as Prefer not to answer, skipped, invalid, screen-out, and quota-full paths.
- Use numeric recodes for ordered scales when that helps analysis.
- Review exports before collecting live data and again after any major edit.
- Instrument Review on the Deploy tab flags non-consecutive numeric recodes — gaps in the sequence (for example 1, 2, 4) and repeated codes that would make two options export identically — before you publish.