We use cookies and similar technologies to improve your experience, analyse traffic, and personalise content. You can accept all cookies or reject non-essential ones.
Rules & Conditional Logic
1. What Are Survey Rules?
Why Use Rules?
How Rules Work
When to Use Rules
2. Rule Conditions
Condition Types Reference
Choosing the Right Condition
Text Matching
Numeric Comparisons
Emptiness Checks
Pattern Matching
3. Rule Actions
Navigation Actions
Visibility Actions
Page Control Actions
4. Creating Rules Manually
Step-by-Step Guide
Editing and Reordering Rules
5. AI Rule Builder
How It Works
Using the AI Assistant
Example Prompts
Skip Logic
Disqualification
Branching
NPS Routing
Conditional Options
Multi-Rule
Reviewing and Modifying AI Suggestions
6. Common Rule Patterns
Skip Logic
Disqualification
Branching
Conditional Options
Branching Visualised
Pattern Implementation Examples
Skip Logic Example
Disqualification Example
NPS Branching Example
7. Troubleshooting
Common Issues
Debugging Checklist
Build intelligent surveys with conditional rules that show, hide, or skip questions based on respondent answers — manually or with AI assistance.
Survey rules are the backbone of intelligent survey design. They let you define conditional logic that dynamically controls what a respondent sees based on the answers they provide. Instead of forcing every participant through the same linear set of questions, rules allow your survey to adapt in real time — showing relevant follow-ups, hiding irrelevant sections, and routing respondents down personalised paths.
Rules transform a static questionnaire into a dynamic, conversational experience. Here are the key benefits:
Every rule consists of two parts: a condition (the trigger) and an action (the result). When a respondent submits an answer that satisfies the condition, the corresponding action is executed immediately. Multiple rules can be defined on a single survey, and they are evaluated in the order they appear in the rules panel.
Anatomy of a Survey Rule
CONDITION
Source Question
Q1: Are you satisfied with our service?
Operator & Value
EQUALS
“Yes”
THEN
ACTION
Action Type
QUESTION_ON_PAGE
Target
Jump to Q3 on Page 2 (skip Q2)
Consider adding rules in these scenarios:
A condition defines the criteria that must be met for a rule to fire. Each condition evaluates the respondent’s answer to a specific source question against a value you specify. SurveyAnalytica supports 11 condition types covering text matching, numeric comparisons, emptiness checks, and pattern matching.
| Condition | Description | Example |
|---|---|---|
| EQUALS | Exact match against the provided value. Case-sensitive for text answers, exact for numeric values. | Answer equals "Yes" |
| NOT_EQUALS | The answer is anything other than the specified value. Useful for exclusion logic. | Answer is not "No" |
| CONTAINS | Checks whether the answer text includes the specified substring anywhere within it. | Answer contains "recommend" |
| NOT_CONTAINS | The answer text does not include the specified substring. Good for filtering out unwanted content. | Answer doesn’t contain "complaint" |
| GREATER_THAN | Numeric comparison where the answer must be strictly greater than the specified value. | Score greater than 7 |
| LESS_THAN | Numeric comparison where the answer must be strictly less than the specified value. | Score less than 4 |
| GREATER_THAN_OR_EQUAL | Numeric comparison where the answer must be greater than or exactly equal to the specified value. | Rating >= 8 |
| LESS_THAN_OR_EQUAL | Numeric comparison where the answer must be less than or exactly equal to the specified value. | Rating <= 3 |
| IS_EMPTY | The respondent did not provide any answer. No comparison value needed. Useful for optional question logic. | Response is blank (skipped question) |
| IS_NOT_EMPTY | The respondent provided some answer. No comparison value needed. Confirms engagement with a question. | Response is not blank (answered) |
| REGEX | Evaluates the answer against a regular expression pattern. Powerful for validating structured input like emails, phone numbers, or custom formats. | Email matches ^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+$ |
Aa
Use EQUALS or NOT_EQUALS for radio buttons, dropdowns, and yes/no questions where answers are fixed values. Use CONTAINS or NOT_CONTAINS for free-text fields where partial matching is needed.
#
Use GREATER_THAN, LESS_THAN, and their inclusive variants for NPS scores, slider values, rating scales, and any question that produces a numeric answer.
?
Use IS_EMPTY and IS_NOT_EMPTY for optional questions where you want different follow-up paths based on whether the respondent chose to answer at all.
.*
Use REGEX for advanced scenarios where you need to validate structured input. Supports full regular expression syntax for maximum flexibility.
Once a condition is satisfied, the rule executes an action that controls the survey flow. SurveyAnalytica provides 10 action types organised into three categories: navigation, visibility, and page control. Each action type targets specific elements within your survey.
Navigation actions change where the respondent is directed next. They override the default sequential flow of the survey.
| Action | Description | Target |
|---|---|---|
| TOP_OF_PAGE | Jumps the respondent to the top of a specific page in the survey. All questions on that page become visible. Useful for directing respondents to an entirely different section. | Page number |
| QUESTION_ON_PAGE | Jumps directly to a specific question on a specific page. More precise than TOP_OF_PAGE when you want to skip only certain questions at the beginning of a page. | Page number + Question ID |
| END_SURVEY | Immediately ends the survey and records the response as complete. The respondent sees the end/thank-you page. Their partial data is saved. | None (survey ends) |
| ABANDON_SURVEY | Ends the survey without recording the response. The respondent’s data is discarded. Use this for disqualification screening where you do not want partial data in your results. | None (survey abandoned) |
Visibility actions show or hide specific questions or answer options within questions. These do not change navigation; they modify what is visible on the current or upcoming pages.
| Action | Description | Target |
|---|---|---|
| FILTER_QUESTIONS | Hides one or more specific questions from the survey. Hidden questions are skipped and do not appear to the respondent. Useful for removing follow-ups that do not apply. | One or more Question IDs |
| SHOW_QUESTIONS | Makes previously hidden questions visible. Use in combination with FILTER_QUESTIONS when you have questions that start hidden and only appear under certain conditions. | One or more Question IDs |
| FILTER_OPTIONS | Hides specific answer options within a question. The question itself remains visible, but certain choices are removed from the option list. Ideal for piped or filtered choice lists. | Question ID + Option IDs |
| SHOW_OPTIONS | Makes previously hidden options visible within a question. Use when answer choices should only appear based on earlier responses. | Question ID + Option IDs |
Page control actions show or hide entire pages in the survey flow. They affect all questions on the targeted page at once.
| Action | Description | Target |
|---|---|---|
| SHOW_PAGE | Makes a previously hidden page visible in the survey flow. The page and all its questions become accessible to the respondent when they navigate to that point in the survey. | Page number |
| HIDE_PAGE | Removes an entire page from the survey flow. The respondent skips over the hidden page as if it does not exist. All questions on that page are effectively invisible. | Page number |
The Rules panel in the survey builder provides a straightforward interface for creating and managing conditional logic. Follow the steps below to add your first rule. Each rule is defined by selecting a source question, condition, value, action, and target.
Add New Rule
x
IF ANSWER TO
Q1: How satisfied are you with our service?
CONDITION
EQUALS
VALUE
Dissatisfied
THEN
QUESTION_ON_PAGE
TARGET
Page 3 > Q8: What could we improve?
Save
Cancel
After creating rules, you can manage them from the Rules panel:
The AI Rule Builder lets you create survey rules by describing what you want in plain English. Instead of manually selecting conditions and actions from dropdowns, simply type a natural language description of the logic you need, and the AI will generate the corresponding rule configuration for your review.
The AI Rule Builder is powered by a streaming AI assistant that understands your survey structure. It knows all your questions, pages, answer options, and supported rule types. When you describe a rule in natural language, the assistant:
AI Rule Builder
x
If the user selects “Dissatisfied” in Q3, skip to the
feedback section on page 4
You
AI Assistant
GENERATED RULE
Source:
Q3: How satisfied are you?
Condition:
EQUALS
“Dissatisfied”
Action:
TOP_OF_PAGE
Page 4 (Feedback Section)
Respondents who are dissatisfied will be directed to the detailed feedback page.
Approve
Reject
Modify
Here are examples of prompts you can type into the AI Rule Builder to generate rules:
“If the answer to Q2 is ‘No’, skip Q3 and Q4 and go directly to Q5.”
“End the survey immediately if the respondent is under 18 in Q1.”
“If Q5 answer contains ‘enterprise’, show page 3. If it contains ‘personal’, show page 4.”
9+
“If the NPS score in Q7 is greater than or equal to 9, jump to the referral section on page 5.”
“Hide the ‘Enterprise Plan’ option in Q10 if Q3 answer equals ‘Individual’.”
“Create three rules: scores 0-6 go to page 2, scores 7-8 go to page 3, scores 9-10 go to page 4.”
The AI Rule Builder presents generated rules as structured cards that you can review field by field. Here is how to handle each scenario:
While the combinations of conditions and actions are virtually unlimited, most survey logic falls into a handful of well-established patterns. These patterns cover the vast majority of real-world use cases and serve as excellent starting points for your own rule configurations.
Skip irrelevant questions based on previous answers. For example, if a respondent has never used your product, skip all product-experience questions and jump to the general feedback section. Uses QUESTION_ON_PAGE or TOP_OF_PAGE actions with an EQUALS or NOT_EQUALS condition on a qualifying question.
End the survey early for respondents who do not meet eligibility criteria. Place screening questions at the beginning of your survey, then use END_SURVEY or ABANDON_SURVEY when a disqualifying answer is detected. Common with age verification, role-based filtering, and consent questions.
Create different paths through the survey based on a pivotal answer. One question routes respondents to entirely different sets of follow-up questions. Uses TOP_OF_PAGE or HIDE_PAGE/SHOW_PAGE to control which sections each respondent sees. Ideal for product-specific or role-specific question paths.
Show or hide specific answer choices within a question based on earlier responses. For example, if a respondent selects “Free plan” in Q2, hide the “Enterprise support” option in Q5. Uses FILTER_OPTIONS and SHOW_OPTIONS actions to dynamically adjust available choices without removing the entire question.
The following diagram illustrates a common branching pattern where a single question routes respondents down two different paths before they reconverge at a final question:
SOURCE QUESTION
Q1: Choose your plan
Option A: Personal
Option B: Business
PERSONAL PATH
Q2a: Personal usage details
BUSINESS PATH
Q2b: Company size & needs
Q3: Final feedback
Both paths converge
Scenario: Q1 asks “Have you used our mobile app?” If the answer is “No”, skip Q2 (“Rate the app experience”) and Q3 (“What features do you use?”) and jump directly to Q4.
| Field | Configuration |
|---|---|
| Source Question | Q1: Have you used our mobile app? |
| Condition | EQUALS |
| Value | “No” |
| Action | QUESTION_ON_PAGE |
| Target | Q4 on Page 1 |
Scenario: Q1 asks “Are you 18 years or older?” If the answer is “No”, end the survey without recording data.
| Field | Configuration |
|---|---|
| Source Question | Q1: Are you 18 years or older? |
| Condition | EQUALS |
| Value | “No” |
| Action | ABANDON_SURVEY |
| Target | None |
Scenario: Q5 is an NPS question (0-10 scale). Route detractors (0-6) to a “What went wrong?” page, passives (7-8) to a general feedback page, and promoters (9-10) to a referral page.
| Rule | Condition | Value | Action | Target |
|---|---|---|---|---|
| Rule 1 (Detractors) | LESS_THAN_OR_EQUAL | 6 | TOP_OF_PAGE | Page 3 (Issues) |
| Rule 2 (Passives) | GREATER_THAN | 6 (+ second rule: LESS_THAN 9) | TOP_OF_PAGE | Page 4 (Feedback) |
| Rule 3 (Promoters) | GREATER_THAN_OR_EQUAL | 9 | TOP_OF_PAGE | Page 5 (Referral) |
Even well-designed rules can sometimes behave unexpectedly. This section covers the most common issues, their root causes, and how to resolve them. If your rules are not working as expected, start here before reaching out to support.
| Problem | Cause | Solution |
|---|---|---|
| Rule not firing | Wrong condition type selected. For example, using EQUALS when the answer includes extra whitespace or formatting, or using a text condition on a numeric field. | Verify the condition matches the answer format. For choice questions, ensure the value matches the exact option text. For numeric questions, use numeric condition types. Use the survey preview to test with the exact answer value. |
| Multiple rules conflict | Two or more rules target the same question or page with contradictory actions. For example, one rule hides Q5 while another shows Q5 based on overlapping conditions. | Review all rules in the Rules panel and check for overlapping conditions. Reorder rules so the most specific conditions are evaluated first. Remove duplicate or contradictory rules. Consider combining conditions into a single rule if possible. |
| Skipped questions still showing | The rule targets the wrong page or question number. This often happens when questions are reordered or pages are added after the rule was created. | Open the rule and verify the target page number and question ID are correct. If you have recently reorganised your survey, update all affected rules to reflect the new structure. |
| AI-generated rule incorrect | Ambiguous or vague prompt given to the AI Rule Builder. The AI may misidentify the source question, choose the wrong condition type, or target the wrong element. | Be more specific in your description. Reference questions by their exact number (Q3) or full label text. Specify the exact condition type if you know it. Mention page numbers explicitly. Review and use the Modify button to fix individual fields. |
| Rule fires on every response | Condition value is too broad. For example, using CONTAINS with a very short string that matches most answers, or using IS_NOT_EMPTY on a required question (which is always answered). | Narrow the condition value. Use EQUALS instead of CONTAINS for exact matching. If using IS_NOT_EMPTY, make sure the source question is actually optional. Test with multiple different answer values in preview. |
| Hidden question data missing | Questions hidden by FILTER_QUESTIONS are not submitted. If a respondent’s path hides a question, no data is recorded for it in the response. | This is expected behaviour. Hidden questions produce null/empty values in your data. Account for this in your analysis by filtering for non-null responses. If you need default values, add them during data processing. |
| Rule order matters unexpectedly | Rules are evaluated top-to-bottom. When multiple rules match the same answer, only the first matching navigation rule takes effect. Visibility rules all apply independently. | Reorder rules using drag-and-drop in the Rules panel. Place the most important and specific rules at the top. Remember that navigation rules (TOP_OF_PAGE, END_SURVEY) stop further rule evaluation, while visibility rules (FILTER_QUESTIONS, SHOW_QUESTIONS) all execute. |
| REGEX condition not matching | Regular expression syntax error or escaping issue. Special characters need proper escaping in the value field. | Test your regex pattern independently using an online regex tester before entering it. Ensure special characters like dots, brackets, and backslashes are properly escaped. Remember that the pattern must match the entire answer string if anchored with ^ and $. |
When a rule is not behaving as expected, work through this checklist:
Need more help? If you are experiencing an issue not covered in this guide, contact our support team at support@surveyanalytica.com or use the in-app chat. For video tutorials on survey rules and conditional logic, visit the SurveyAnalytica Learning Center.