Load and Clean KoboToolbox Data
kobo_load_dataDownloads all form submissions, cleans and labels data, flattens groups, and reports data quality for analysis. Use this first to prepare a complete dataset.
Instructions
Download ALL submissions of a form and prepare them for analysis. Start every analysis here.
Unlike kobo_list_submissions (one page of raw records), this pulls the whole dataset, replaces stored choice codes with their labels, converts numbers and dates, flattens groups, and reports data quality. The cleaned snapshot is cached for 15 minutes and reused by kobo_analyze, kobo_crosstab, kobo_get_data_sample and kobo_build_report.
Args:
uid (string): the form's asset uid
query (string, optional): Mongo-style server-side filter, e.g. '{"region":"Sud-Ouest"}'
max_rows (number): safety cap (default: everything, up to 50000)
language (string, optional): label language for multilingual forms
refresh (boolean): re-download instead of using the cache
response_format ('markdown' | 'json')
Returns: the list of analysable questions with their measurement type (categorical / numeric / datetime / text) and answer options, the number of submissions, and a data-quality summary (missing values, duplicates, skipped repeat groups).
Use the returned question list to decide what to analyse — its "field" values are what you pass to the other tools.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uid | Yes | Asset uid of the form (from kobo_list_forms) | |
| query | No | Optional Mongo-style filter applied server-side, e.g. '{"region":"Sud-Ouest"}' or '{"_submission_time":{"$gte":"2026-01-01"}}' | |
| refresh | No | Force a fresh download instead of reusing the cached snapshot (cache lasts 15 min) | |
| language | No | Preferred label language for multilingual forms, e.g. 'Français' or 'fr' | |
| max_rows | No | How many submissions to pull. Defaults to 50000, which protects against dragging a huge project into memory; pass a higher value explicitly to analyse a project larger than that. | |
| response_format | No | Output format: 'markdown' for human-readable or 'json' for machine-readable | markdown |