Incorrect School-to-Ward Mapping in KoboToolbox Exports After Moving Cascading Choices to External CSV Files

Incorrect school-to-ward mapping in exported KoboToolbox submissions after moving cascading choices to external CSV files

I am using KoboToolbox on the EU server (eu.kobotoolbox.org) with an XLSForm for a school monitoring tool. The form has cascading select questions for Region, Council, Ward and School.

Previously, the cascading lists were maintained in the XLSForm choices sheet. In the latest form update, I moved these lists into four external CSV files attached as media: regions.csv, councils.csv, wards.csv and schools.csv.

During data collection, the cascading selections work correctly: selecting a region filters the councils, selecting a council filters the wards, and selecting a ward filters the schools.

However, when I download the submissions from KoboToolbox, many schools appear to be associated with incorrect wards. I have deployed multiple versions of this form, and the project currently has 16 form versions.

I need help identifying the root cause and ensuring that exported submissions correctly reflect the region, council, ward and school selected by the data collectors. I also need to understand how to export the human-readable labels rather than internal choice IDs, and how to handle submissions collected under different form versions.

What’s happening instead?

The cascading selections appear correct during data collection, but the downloaded Excel export contains many school-to-ward combinations that appear incorrect.

The cascading lists are now stored in external CSV media files rather than the XLSForm choices sheet. The CSV files use name as the choice identifier, label as the display label, and parent-reference columns to link councils to regions, wards to councils, and schools to wards.

I have checked the current CSV files, and their parent references appear to point to existing records. However, the exported submissions contain inconsistent identifier formats across the location fields, including values such as region8, r8, r9, council1_region8, r8c1w1, and numeric IDs.

I have 16 deployed form versions, so I am unsure whether the issue is related to version-specific choice mappings, the external CSV configuration, the stored submission values, or how KoboToolbox resolves labels during export.

I have tried exporting without selecting “Include fields from all 16 versions”, but this did not establish whether the downloaded submissions were collected using the latest form version.

I would appreciate guidance on how to diagnose the mismatch, verify the original saved values, and safely produce an export with the correct school and ward labels without losing or corrupting existing submissions.

I can provide the XLSForm, all four external CSV files, and the downloaded Excel exports for investigation.

Attach relevant files (XLSForm, CSV, Screenshots, Logs)

School Monitoring Tool v8 - latest version - used csv for cascading choices.xlsx (54.9 KB)School Monitoring Tool v7 - previous version with cascading choices under choices sheet of XLSForm.xlsx (278 KB)councils.csv (3.42 KB)regions.csv (397 Bytes)wards.csv (65 KB)schools.csv (135 KB)

@Xiphware @wroos and all, a kind help please

For a start, your wards.csv looks to be malformed - it contains multiple duplicates entries (with what appears to be multiple different councils associated to the same ward :face_with_raised_eyebrow: ). eg

name label council
2 Bangata 2
3 Bwawani 2
3 Bwawani 84
3 Bwawani 70

4 Ilkiding’a 2
5 Kimnyaki 2
6 Kiranyi 2
7 Kisongo 2
8 Kiutu 2
9 Laroi 2
10 Lemanyata 2
11 Lengijave 2
12 Mateves 2
13 Mlangarini 2
14 Moivo 2
15 Musa 2
16 Mwandet 2
17 Nduruma 2
17 Nduruma 115
18 Oldonyosambu 2
18 Oldonyosambu 8

19 Oldonyowas 2
20 Oljoro 2
21 Olmotonyi 2
22 Oloirien 3
22 Oloirien 2

23 Olturoto 2

…

Since you are (now) pulling data out of these external csv files at runtime - and not from the regular choices sheet - these duplicates wont trigger the “duplicate choices” error that you usually see. Nonetheless, they’re probably going to cause issues with your filtering, so I’d first recommend fixing these up and then retrying your form to see if that makes a difference.

Apologies, I do not know what happened but the correct csv files that I used are the attached in this reply. There are no any duplicates on either files. And it still acts the same way

Please ignore the first ones.

councils.csv (967 Bytes)

schools.csv (111.7 KB)

wards.csv (20.9 KB)

regions.csv (98 Bytes)