SurveyLoopr
Tips & Tricks
5 min read

How to Add Skip Logic in XLSForm

Mehrab Ali
Mehrab AliPublished June 9, 2026

Skip logic in XLSForm is controlled by the relevant column: a question appears only when its relevant expression is true. This lets you skip questions that do not apply, such as hiding a follow-up question after a negative answer, so enumerators see only the relevant path for each interview.

After writing the expression, use the XLSForm validation checklist to test every branch on a device and inspect the exported columns.

Skip logic is one of the most important reasons to collect data digitally instead of on paper. On paper, an enumerator has to read "if no, skip to question 12" and hope they follow it. In an XLSForm, the form does it automatically and never gets it wrong.

How does the relevant column work?

Add a column called relevant to your survey sheet. In any question's relevant cell, write a condition. The question is shown only when that condition evaluates to true; otherwise it is skipped and left blank.

typenamelabelrelevant
select_one yes_nohas_childrenDo you have children?
integernum_childrenHow many children do you have?${has_children} = 'yes'
surveychoicessettings

Here, num_children only appears when the respondent answered "yes" to has_children. The ${has_children} syntax references the earlier answer.

Warning:

Always match the choice name, not its label. If your choices sheet defines a choice with name yes and label Yes, I do, your condition must be = 'yes' — the lowercase name — or the logic will never trigger.

How do you combine multiple conditions?

Use and and or to build conditions from more than one answer. Wrap separate clauses in parentheses for clarity:

typenamelabelrelevant
integerageWhat is your age?
select_one yes_noconsentDo you consent to continue?
textjob_titleWhat is your job title?${age} >= 18 and ${consent} = 'yes'
surveychoicessettings
  • and — every condition must be true.
  • or — at least one condition must be true.
  • != — "not equal to", useful for "show unless".

For a question that should appear for several choices, selected() is cleaner than chaining or:

typenamelabelrelevant
select_one regionregionWhich region?
textcity_noteAdd a note for this regionselected(${region}, 'north') or selected(${region}, 'south')
surveychoicessettings

How do you skip an entire section?

To skip many questions at once, put the relevant condition on a group instead of repeating it on every row. Every question inside the group inherits the condition:

typenamelabelrelevant
select_one yes_noemployedAre you currently employed?
begin groupemploymentEmployment details${employed} = 'yes'
textemployerWho is your employer?
integersalaryWhat is your monthly salary?
end groupemployment
surveychoicessettings

If employed is not "yes", the whole employment section is skipped. This keeps your form readable and your logic consistent.

Tip:

Building skip logic by hand is error-prone for large forms. In LooprAI Workspace you can describe the rule in plain English — "only ask about employer if they're employed" — and it writes the correct relevant expression for you.

Why skip logic matters in the field

Good skip logic does more than tidy the form — it protects your data. Questions that do not apply are left genuinely blank rather than filled with junk, your constraints only fire on relevant answers, and interviews run faster because enumerators skip irrelevant blocks automatically. The result is cleaner data and shorter interviews.

Build my first form free

Next: XLSForm Constraint Examples →

Frequently Asked Questions

What column controls skip logic in XLSForm?

The relevant column controls skip logic. A question appears only when its relevant expression evaluates to true, so you write a condition like ${has_children} = 'yes' to show a question conditionally based on an earlier answer.

How do I reference a previous answer in XLSForm skip logic?

Use the ${question_name} syntax to reference an earlier answer inside a relevant expression. Match the value against the choice name from your choices sheet, not the display label, or the condition will not trigger correctly.

How do I combine multiple conditions in skip logic?

Use 'and' to require every condition to be true and 'or' to require at least one. For example, ${age} >= 18 and ${consent} = 'yes' shows a question only to consenting adults. Use selected() to match several choices cleanly.

How do I skip a whole section in XLSForm?

Put the relevant condition on a begin group row. Every question inside that group inherits the condition and is shown or skipped together, which is cleaner than repeating the same relevant expression on each individual question.

Why is my XLSForm skip logic not working?

The most common cause is matching the choice label instead of the choice name. Check that your relevant expression uses the lowercase name from the choices sheet, that ${} references an existing question name, and that quotes around text values are straight single quotes.

No Credit Card Required

Build the form first. Add hosting when you need it.

Start free with LooprAI, then deploy a managed ODK Central server or run DataSnap checks when your project is ready.

Hundreds of users trust SurveyLoopr