Search the knowledge base, browse our resources, and visit our forum for more detailed information
Last updated: 25 Nov 2025
Skip logic, also known as relevance logic, allows you to determine when a question or group of questions will be displayed in the form based on a previous question or the result of a calculation. For example, you can use it to ask follow-up questions only to a subset of respondents, or to hide entire sections of a form if they are not relevant.
To learn more about form logic in XLSForm, see Introduction to form logic in XLSForm.
This article covers the following topics:
Adding skip logic to individual questions
Combining multiple skip logic conditions
Adding skip logic based on whether a question was answered
Adding skip logic to question groups
Note: This article focuses on adding skip logic in XLSForm. To learn about adding skip logic in the KoboToolbox Formbuilder, see Adding skip logic in the Formbuilder.
For hands-on practice with skip logic in XLSForm, see KoboToolbox Academy’s XLSForm Fundamentals Course.
Skip logic uses question referencing to only display questions that are relevant to the respondent based on previous answers. The question used to define the relevance logic is referred to as the reference question.
To add skip logic in XLSForm:
Add a relevant column to the survey worksheet.
In the row of the question you wish to display or hide, enter the condition that must be met for the question to be displayed.
survey worksheet
type |
name |
label |
relevant |
|---|---|---|---|
integer |
age |
How old are you? |
|
select_one yn |
married |
Are you married? |
${age} > 18 |
survey |
In the example above, ${age} is the reference question, and the answer to ${age} must be greater than 18 for the “Are you married?” question to be displayed.
The format of the skip logic condition will differ according to the type of the reference question, as detailed in the table below.
Reference question type |
Skip logic condition |
Example |
|---|---|---|
select_one |
|
|
select_multiple |
|
|
integer |
|
|
date |
|
|
To learn more about building form logic expressions in XLSForm, see Introduction to form logic in XLSForm.
Multiple relevance conditions can be combined into a single expression to determine when a question is displayed based on a previous response. Conditions can be combined using and, or, and not logical operators:
Use and when all conditions must be met for a question to be displayed.
For example: ${age} > 18 and ${student} = ‘no’
Use or when at least one condition must be met for a question to be displayed.
For example: ${age} < 18 or ${student} = ‘yes’
Use not to indicate that a condition or set of conditions must not be met (e.g., when two conditions cannot be true together for a question to be displayed).
For example: not(${age} > 18 and ${student} = ‘yes’)
survey worksheet
type |
name |
label |
relevant |
|---|---|---|---|
integer |
age |
What is your age? |
|
select_one yn |
employed |
Are you employed? |
${age} >= 16 and ${age} <= 75 |
survey |
In addition to adding skip logic based on a specific response, you can add skip logic based on whether a question was answered or left blank. This can be useful to add follow-up questions, or when using acknowledge questions in your form.
Unanswered questions are treated as empty strings, noted as two single apostrophes ''. The following skip logic conditions can be used:
Skip logic condition |
Description |
|---|---|
|
Display only if |
|
Display only if |
survey worksheet
type |
name |
label |
relevant |
|---|---|---|---|
text |
why_joined |
Why did you join? |
|
select_one yn |
benefits |
Are you seeing benefits? |
${why_joined} != ‘’ |
survey |
Skip logic can be applied to question groups as well as individual questions. Applying skip logic to a group will show or hide all questions within that group based on previous responses.
To add skip logic to question groups:
Add a relevant column to the survey worksheet.
In the begin_group row of the question group you wish to display or hide, enter the condition that must be met for the group to be displayed.
survey worksheet
type |
name |
label |
relevant |
|---|---|---|---|
select_one yn |
joined |
Did you join the association? |
|
begin_group |
association |
Association participation |
${joined} = ‘yes’ |
date |
date_joined |
When did you join the association? |
|
select_one yn |
voted |
Have you ever voted in any election for the association? |
|
end_group |
|||
survey |
Did you find what you were looking for? Was the information clear? Was anything missing?
Share your feedback to help us improve this article!
KoboToolbox is maintained by Kobo Inc.