Conditional logic and variables
Logic & Variables is a shared editor tab for surveys, usability tests, and in-product surveys.
Where you can add logic
Section titled “Where you can add logic”You can control what participants see at different levels in the study builder:
| Level | Where you set it | What it does |
|---|---|---|
| Question | Logic & Variables → select a question | Show or hide follow-up questions based on earlier answers |
| Page | Logic & Variables → select a page | Skip pages or change the path through the study |
| Page qualification | Screener or legal pages in Build | Pass or fail participants before they continue (e.g. screening questions) |
| Page asset display | Usability test pages with prototypes | Show a different prototype to different participants |
| Section | Section settings in the page sidebar | Show, 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.
Building rules
Section titled “Building rules”In the Logic & Variables UI:
- Select a question, page, or section.
- Add a condition (variable or answer comparison).
- 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
Section titled “Variables”Variables power logic, piping, and SDK dynamic values.
Types of variables
Section titled “Types of variables”| Type | Examples |
|---|---|
| Answer | A previous question’s response |
| Participant | Data from a participant sample (e.g. segment) |
| URL | Values from the link (?plan=pro) |
| Session | Device, browser, or referrer (filled in automatically) |
| Computed | Result of a formula you define |
| Custom | Values 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).
Using variables in text and formulas
Section titled “Using variables in text and formulas”- Insert a variable in question text or messages using its name, e.g.
{{customer_plan}}. - Build formulas with functions like
IF,AND,OR, andSUMfor computed variables.
In Logic & Variables, use validation tools in the UI (e.g. check undefined) before publishing to catch broken references.
In-product dynamic values
Section titled “In-product dynamic values”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.
Best practices
Section titled “Best practices”- Name variables clearly (
plan_typenotv1). - 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).