Skip to content

Conditional logic and variables

Logic & Variables is a shared editor tab for surveys, usability tests, and in-product surveys.

You can control what participants see at different levels in the study builder:

LevelWhere you set itWhat it does
QuestionLogic & Variables → select a questionShow or hide follow-up questions based on earlier answers
PageLogic & Variables → select a pageSkip pages or change the path through the study
Page qualificationScreener or legal pages in BuildPass or fail participants before they continue (e.g. screening questions)
Page asset displayUsability test pages with prototypesShow a different prototype to different participants
SectionSection settings in the page sidebarShow, hide, or shuffle whole groups of pages; branch between section paths

For a full guide on when to use randomisation vs display logic vs compare assets, see Group comparison and routing.

When participants take your study (or when you use Preview), FromUsers applies these rules automatically using your variables.

In the Logic & Variables UI:

  1. Select a question, page, or section.
  2. Add a condition (variable or answer comparison).
  3. Choose an action: show, hide, skip to page, disqualify, etc.

When you duplicate a study, logic rules are copied and updated so they still point to the right questions and variables.

Variables power logic, piping, and SDK dynamic values.

TypeExamples
AnswerA previous question’s response
ParticipantData from a participant sample (e.g. segment)
URLValues from the link (?plan=pro)
SessionDevice, browser, or referrer (filled in automatically)
ComputedResult of a formula you define
CustomValues you set manually or from your website (in-product)

Variables can also come from formulas, randomization, cookies, or your site’s data layer (in-product surveys).

  • Insert a variable in question text or messages using its name, e.g. {{customer_plan}}.
  • Build formulas with functions like IF, AND, OR, and SUM for computed variables.

In Logic & Variables, use validation tools in the UI (e.g. check undefined) before publishing to catch broken references.

The SDK only captures variables you define on the study. Map:

  • Analytics data layer keys
  • Cookies
  • URL params
  • Session fields

into variables in Logic & Variables, then use them in logic or question text.

  • Name variables clearly (plan_type not v1).
  • Run check undefined before publish to catch broken references.
  • Keep screener logic on early pages to avoid collecting bad data.
  • Test with Preview using different URL params (?segment=b).