Logic rules

Logic makes a survey react to what a respondent has already said. Every rule has the same two halves: a condition that’s checked, and an action that happens when it’s met.

Rules are created on the thing they act on. A display rule created on a question shows or hides that question; the rule form doesn’t ask you which target to pick, because the place you created it is the answer.

Building a condition

A condition compares something to a value:

  • Source — an earlier question’s answer, its score, or its selection count (how many options were ticked).
  • Operator — is, is not, contains, does not contain, is any of, is all of, is greater than, is at least, is less than, is at most, is between, is empty, is answered.
  • Value — what you’re comparing against. For a choice question you pick the choices rather than typing text.

Conditions can be combined, so “over 65 and answered yes to the screener” is one rule, not two.

The question you condition on must come earlier than the thing the rule acts on. Respondents answer a page at a time, so an answer can only drive something they haven’t reached yet.

The six rule types

Display — show, hide, enable, disable, require or make optional the page, block or question the rule sits on, when the condition is met. The everyday rule: ask the follow-up only to people whose answer calls for one.

Skip — if this question’s answer matches, skip it or jump ahead to a destination in the survey, hiding everything in between.

Branch — if this question’s answer matches, send the respondent somewhere else: to a specific page, to the end of the survey, to a screen out, or to a URL you provide.

Termination — if this question’s answer matches, end the survey early. A one-purpose version of branching, and clearer to read in a rule list when that purpose is “this person is finished”.

Scoring — add points to the response total when the condition is met. Only needed for points that don’t come from a single choice; scores set on individual choices are totalled automatically.

Piping — substitute this question’s answer into later questions. The rule gets its own token; paste that token anywhere in a later question’s text or description and the respondent’s own answer appears there. Piping needs a single flat answer, so it’s available on text, numerical, slider, date and single-choice questions.

Reading logic back

Questions carrying rules are badged in the builder, so you can see at a glance where the survey branches. Before anything goes out, walk the paths in Preview — logic is the part of a survey most worth testing, because a broken rule doesn’t error, it just quietly asks the wrong person the wrong thing.

Changing logic once responses exist

Reworking rules mid-collection changes who gets asked what, which splits your dataset even though every question looks unchanged. It’s safe for respondents — existing distributions stay pinned to their version — but note the boundary. See Editing a live survey.

Related articles