You already know basic forms. Now it's time to make them smart. In XLSForm, three superpowers change everything:
Constraints stop bad answers (e.g., age must be between 5 and 99). Relevance hides questions that don't apply (e.g., "What's your dog's name?" only shows if you said you have a dog). Calculations do math automatically (e.g., total = price ร quantity).
Ever filled a form where you pick "Africa," then only African countries show up? That's a cascading select. In XLSForm, you use choice_filter to link choices together.
Example: choose a region โ only that region's cities appear. Choose a category โ only that category's items appear. It makes long lists way easier to navigate!
Collecting info about 5 siblings? 20 trees in a park? 100 survey responses? Repeat groups let you ask the same set of questions over and over โ and each round is stored separately.
You'll also learn to aggregate repeats: count how many were collected, sum a number, or find the highest value. That's advanced data wizardry.
What happens when you edit a form while people are still using it? Chaos! Form versioning in KoboToolbox lets you publish a new version without losing old submissions.
You'll learn to bump version numbers, test in a sandbox, and deploy updates safely โ like updating an app without crashing everyone's phone.
Some answers must follow a strict pattern โ like phone numbers, email addresses, or codes. Regular expressions (regex) let you describe that pattern, and KoboToolbox rejects anything that doesn't match.
Example: a phone number must be 10 digits. A student ID must start with "STU" and end with 4 numbers. Once you learn regex, you can enforce almost any rule.
If your choice list has 500 items (like all the schools in a district), typing them into the form is painful. Instead, upload a CSV file with the choices and reference it from your XLSForm.
The best part? You can update the CSV without rebuilding the whole form. Perfect for big surveys that change often.
Rule builder: Create a form with three constraints (age between 5โ99, name at least 2 characters, date not in the future). Try submitting bad answers and see the form block them.
Smart hiding: Build a form where "What's your pet's name?" only appears if you answer "yes" to having a pet. Use relevant for this!
Cascading selects: Make a form with "Continent โ Country โ City." Use choice_filter so each level filters the next.
Repeat & count: Create a repeat group for "siblings." Ask each sibling's name and age, then add a calculation that counts how many were entered.
Regex challenge: Add a text question for "student ID" and use a regex to require it starts with "STU" and ends with 4 digits. Test valid and invalid inputs.
CSV upload: Create a small CSV of 10 choices, upload it to KoboToolbox, and reference it from a select question. Update the CSV and see the change.
By the end of this module, you'll be able to: write advanced XLSForm logic, build cascading selects, use repeat groups, version forms safely, validate with regex, and manage external CSV choice lists.