How logic works: conditions, AND/OR, display vs. action.

Logic controls what each respondent sees and what happens as they answer. Display logic decides who sees a question, choice, statement or variable. Action logic does something when a condition is met, such as screen out, jump or tag. Other tools call this skip logic, branching, routing or conditional questions.

Open the logic editor

  1. In the Build tab, open the question and click the logic icon (branching arrows) in its header.
  2. Click Add Display Logic, Add Action Logic or Add Quick Tags and build the rule. Action rules read If... / Then.... Display rules read Display... (what to show) / When... (the condition).
  3. Click Save & Close.

Logic editor open on Q7 (How often do you drink soft drinks?), showing its rules and the three Add buttons

Sections have a logic editor too, for display logic and action logic.

Display logic: decide who sees something

A display rule shows something only to respondents who meet its condition. It controls the whole question by default. Depending on the question type, you can switch Display... from Question to Choices, Statements or Variables.

Example, from a short concept test for a new Kirra flavour: Q9 (Why are you unlikely to buy it?) is displayed if respondent selected Q8 any of "Definitely would not buy", "Probably would not buy". Everyone else skips Q9.

Logic editor on Q9 (Why are you unlikely to buy it?) with one display rule on Q8; the answer dropdown is open with Definitely would not buy and Probably would not buy ticked

Action logic: do something when a condition is met

Set the condition in If... and pick an action in Then...:

  • exit the survey: screens the respondent out as an exit.
  • submit the survey: ends the survey early as a complete.
  • quality exit the survey: records a quality exit, for example a failed attention check.
  • jump to a question, jump to a section: skip ahead.
  • add tag, remove tags: a tag is a label on the respondent, used in logic, quotas and filters.
  • add least filled tags, retain least filled tags: spread respondents evenly across a set of tags.
  • hide groups: hide a whole group of questions.
  • add to list: add an item to a named list.
  • set variable: store a key and a value. You can pipe lists and variables into later questions.

The conditions you can use

  • respondent selected: the answers given at any question, including text questions.
  • respondent's answer count: how many choices they selected, or text fields they filled in.
  • respondent answered question, respondent didn't answer question: whether they answered at all.
  • respondent has tags: tags given in this survey.
  • respondent has prior tags: tags given in previous Glow surveys, within a time period you specify.
  • list: the items in a list built with add to list, or how many it holds.
  • respondent displayed: whether a loop, statement, choice or variable was shown to them.
  • Inside a loop there is also a "respondent is in loop" condition.

Any of, all of, none of

Each condition takes a quantifier:

  • any of: an OR. The respondent selected at least one of the choices you list.
  • all of: an AND. They selected every one.
  • none of: they selected none of them.
  • exactly: they selected those options and nothing else. With Alpha and Bravo listed, "all of" is true for Alpha + Bravo + Charlie, but "exactly" is true only for Alpha + Bravo. On tags, "exactly" means the respondent has those tags and no others, so any other tag makes it false.

For numbers (an answer count, a numeric answer, the number of items in a list), the quantifiers are less than, greater than and equal to.

Combine conditions with AND and OR

  • AND: click the + button next to a condition to add another condition to the same rule. Every condition in one rule must be true. In the concept test, a rule on Q3 (How often do you drink soft drinks?) adds the tag Young heavy drinker only if respondent selected Q1 any of 18-24 AND respondent selected Q3 any of Every day.
  • Several outcomes: click the + button next to an outcome to add another outcome to the same rule. On Q7 of the demo survey, "Every day" and "A few times a week" add the tag Heavy drinker and set the variable period to week.
  • OR: add a separate rule with the same outcome. Click the duplicate icon on the rule and edit the copy, or add a new rule. In the concept test, two more rules on Q3 each add the tag Core target: one if respondent selected Q1 any of 18-24, one if respondent selected Q3 any of Every day. A respondent who is 18-24 OR drinks soft drinks every day gets the tag.

Logic editor on Q3 in the concept test with three rules: one rule with two conditions joined by AND that adds the tag Young heavy drinker, and two separate rules that each add the tag Core target

Good to know

  • Display rules on the same question are alternatives: if any one is true, the question shows.
  • Action logic runs when the respondent leaves the question.
  • A rule cannot use a tag that another rule on the same question has added. Use the tag in a rule on a later question. The one exception is retain least filled tags.
  • To reuse the same conditions in several places, add a tag once and use it with the condition respondent has tags.
  • Show Logic in the Edit Survey panel shows every rule under its question, marked with an orange ribbon. Hide Logic turns it off.
  • Respondents never see logic in a live survey. Preview shows logic notes before the Next button, such as why a question is visible.

Common questions

What is the difference between display logic and action logic?
Display logic decides who sees a question, choice, statement or variable. Action logic does something once a respondent answers, such as exit the survey, jump to a section or add a tag.

How do I add skip logic or branching in Glow?
Open the question and click the logic icon (branching arrows). Use Add Display Logic to route around that question, or Add Action Logic with jump to a question or jump to a section to skip a large block.

How do I write AND and OR conditions in logic?
For AND, click the + button on a logic rule to add another condition: all conditions in one rule must be true. For OR, add a second, separate rule with the same outcome.

Why does my "none of" rule not work for people who skipped the question?
A logic condition about a question the respondent never saw is always false, even with none of. Use a tag instead, or the condition respondent didn't answer question.

Related

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.