Hiring Partners
Segilola Resources Operating LimitedTaviatech TechnologiesFCMBMTN NigeriaAdvans La Fayette Microfinance BankAboki AfricaFirst Bank of NigeriaOPay
โ† Certified GeoServer/KoboToolbox User Level Three ยท Lesson 8 of 12

Module Seven

๐Ÿ“– Every lesson in this course is free to read right here, no account needed. Create a free account to track your progress, take the exam, and earn your certificate.
8
Module 7: Advanced XLSForm & KoboToolbox
Level Three ยท Module 7

Advanced XLSForm & KoboToolbox

Design sophisticated geospatial surveys with XLSForm: advanced question types, relevance logic, constraints, calculations, groups, repeats, and cascading selects, deployed and managed in KoboToolbox.

Duration: 6 hours Format: Theory + Hands-on Lab Prerequisites: Modules 1โ€“6

Module Overview

KoboToolbox is a powerful platform for mobile data collection, and its flexibility comes from XLSForm, a spreadsheet-based form definition format. This module takes learners beyond basic forms into advanced survey design: geospatial question types, dynamic relevance logic, validation constraints, calculated fields, grouped and repeated sections, and cascading selects.

Learners will also explore form versioning, redeployment strategies, and project permission management, ensuring that surveys remain maintainable and secure throughout their lifecycle.

Learning Objectives

  • Design advanced XLSForm surveys with geospatial question types.
  • Implement relevance conditions, constraints, and calculations using XPath.
  • Organize forms with groups, repeats, and cascading selects.
  • Apply form versioning and redeployment best practices.
  • Manage KoboToolbox project permissions and roles.
  • Validate and troubleshoot complex forms before deployment.

Topics Covered

7.1 Advanced Question Types

  • geopoint, geotrace, geoshape
  • image, audio, file
  • barcode and external CSV
  • Question type selection guidance

7.2 Relevance & Constraints

  • Relevance conditions
  • Constraint expressions
  • Constraint messages
  • Required versus optional

7.3 Calculations & XPath

  • XPath expressions
  • Arithmetic and string functions
  • Calculated fields
  • Dynamic defaults

7.4 Groups & Repeats

  • begin_group / end_group
  • begin_repeat / end_repeat
  • Nested structures
  • Repeat counts and indexing

7.5 Cascading Selects

  • choice_filter expressions
  • Dependent choice lists
  • Dynamic filtering
  • Validation of cascades

7.6 Versioning & Permissions

  • Form versions and redeployment
  • Data migration considerations
  • Project roles and permissions
  • Media attachments management

Detailed Content

7.1 Advanced Question Types

XLSForm supports specialized question types that capture rich data beyond simple text and numbers. Geospatial question types are particularly valuable for field surveys.

  • geopoint: Captures a single GPS coordinate.
  • geotrace: Captures a line or path.
  • geoshape: Captures a polygon.
  • image, audio, file: Capture media attachments.
  • barcode: Scans barcodes or QR codes.
Question TypeCapturesTypical Use
geopointSingle coordinateFacility location
geotraceLineRoad or river path
geoshapePolygonField boundary
imagePhotoSite documentation
audioSound recordingInterview recording

7.2 Relevance & Constraints

Relevance conditions control when a question is shown, while constraints validate the values entered. Both use XPath expressions, enabling dynamic and context-aware surveys.

  • Relevance: Show a question only when a condition is met.
  • Constraint: Validate answer values against a rule.
  • Constraint message: Display a helpful error when validation fails.
  • Required: Force an answer before proceeding.
# Example relevance and constraint columns
type        | name       | label              | relevant         | constraint      | constraint_message
select_one  | has_water  | Is water available?|                  |                 |
integer     | water_hrs  | Hours per day      | ${has_water}='yes' | . >= 0 and . <= 24 | Must be between 0 and 24
Best practice Always provide a clear constraint_message that tells the respondent what went wrong and how to correct it.

7.3 Calculations & XPath

Calculations compute values dynamically from other answers or system data. XPath is the expression language used throughout XLSForm.

  • Arithmetic: Sum, difference, product, and division of fields.
  • String functions: Concatenation, substring, and length.
  • Calculated fields: Fields computed from other responses.
  • Dynamic defaults: Pre-fill fields based on other answers or metadata.
# Example calculation
type        | name      | label          | calculation
calculate   | total     |                | ${price} * ${quantity}
calculate   | full_name |                | concat(${first_name}, ' ', ${last_name})

7.4 Groups & Repeats

Groups organize related questions, and repeats allow a set of questions to be answered multiple times within a single submission. These structures are essential for complex surveys.

  • Groups: Group related questions under a shared label or relevance.
  • Repeats: Repeat a section for multiple entries (e.g., household members).
  • Nested structures: Combine groups and repeats for complex logic.
  • Repeat counts: Reference repeat entries by index using XPath.
# Example repeat structure
type          | name         | label
begin_repeat  | members      | Household members
text          | member_name  | Name
integer       | member_age   | Age
end_repeat    | members      |

7.5 Cascading Selects

Cascading selects filter the options of one question based on the answer to a previous question. This is useful for hierarchical data such as region โ†’ district โ†’ ward.

  • choice_filter: Filter choices based on another field's value.
  • Dependent lists: Link choices to a parent question.
  • Dynamic filtering: Enable drill-down selection in the field app.
  • Validation: Ensure cascaded choices remain consistent.
# Example cascading select
# survey sheet
type          | name     | label     | choice_filter
select_one rg | region   | Region    |
select_one ds | district | District  | region=${region}

# choices sheet
list_name | name  | label    | region
rg        | north | North    |
rg        | south | South    |
ds        | n1    | North 1  | north
ds        | s1    | South 1  | south
Warning Cascading selects depend on exact string matching. Inconsistent capitalization or spacing in choice lists will break the filter.

7.6 Versioning & Permissions

Forms evolve over time. KoboToolbox supports versioning and redeployment, but redeployment must be handled carefully to preserve data integrity.

  • Form versions: Each redeployment creates a new version of the form.
  • Existing submissions: Remain tied to the version they were submitted under.
  • Data migration: Plan for changes to field names or types that affect analysis.
  • Permissions: Assign project roles (Owner, Editor, Viewer) to control access.
  • Media attachments: Manage storage and access for uploaded files.
RolePermissionsTypical Use
OwnerFull controlProject administrator
EditorView and edit dataData manager
ViewerView data onlyStakeholder or analyst

Hands-On Lab: Build a Multi-Section Geospatial Survey with Validation Logic

In this lab, you will design a comprehensive field survey that captures GPS coordinates, uses relevance and constraints, includes repeats and a cascading select, and is deployed and versioned in KoboToolbox.

Lab Steps

  1. Create an XLSForm with a settings sheet defining the form title and ID.
  2. Add a geopoint question to capture the site location.
  3. Add a select_one question for region and a cascading select_one for district using choice_filter.
  4. Add a begin_repeat section for household members with name and age fields.
  5. Add a constraint on age to require values between 0 and 120, with a clear constraint_message.
  6. Add a calculate field that counts the number of repeat entries.
  7. Validate the form using XLSForm Online or Kobo's validation, then import and deploy it to KoboToolbox.
  8. Submit a test response, then redeploy a revised version and verify that existing submissions remain intact.
Deliverable: A working XLSForm deployed to KoboToolbox containing at least one geopoint, one cascading select, one repeat group, and validation logic. Include a short report documenting the form structure, validation rules, and versioning approach.

Suggested Session Timeline (6 Hours)

  • 0:00 โ€“ 0:45 โ€” Advanced question types and geospatial capture
  • 0:45 โ€“ 1:30 โ€” Relevance, constraints, and validation
  • 1:30 โ€“ 2:15 โ€” Calculations and XPath
  • 2:15 โ€“ 2:30 โ€” Break
  • 2:30 โ€“ 3:15 โ€” Groups, repeats, and cascading selects
  • 3:15 โ€“ 4:00 โ€” Versioning, redeployment, and permissions
  • 4:00 โ€“ 5:30 โ€” Hands-on lab
  • 5:30 โ€“ 6:00 โ€” Review, Q&A, and lab debrief

Assessment

CriteriaWeight
Correct use of advanced question types15%
Relevance, constraints, and validation logic25%
Calculations and XPath expressions15%
Groups, repeats, and cascading selects20%
Versioning and permissions documentation15%
Form validation and deployment report10%

Pass mark for this module: 70%

Resources

  • KoboToolbox documentation โ€” XLSForm reference
  • XLSForm Online validation tool
  • XPath function reference
  • KoboToolbox project permissions guide
  • Sample geospatial survey datasets
© 2026 Certified GeoServer/KoboToolbox User โ€” Level Three ยท Module 7: Advanced XLSForm & KoboToolbox

๐Ÿ† Get Certified

๐Ÿ”’

Earn this certificate

Every lesson is already free to read. Sign up, finish the lessons, pass the exam (โ‚ฆ2,000 or 20,000 coins), and get a verified certificate with your name on it.

๐ŸŽ“ Sign Up to Get Certified
๐Ÿ› ๏ธ Practice Tools
Hands-on simulators & labs - subscription required.
โ†’
๐ŸŽฏ Internship Tasks
Real-world tasks to build your portfolio - unlock them with a subscription.
โ†’