Hello everyone,
I am building a survey form in KoboToolbox (draft stage, not yet deployed) and I get the following error as soon as I open the form preview:
TypeError: Cannot read properties of null (reading ‘textContent’)
The form does not load at all.
Form architecture
style: pagesin the settings sheet- 1 field
select_one_from_file sites_pulldata.csv(external CSV, 345 rows, UTF-8, first column =nom_site) - 9
calculatefields usingpulldata()to retrieve attributes from that CSV:
pulldata('sites_pulldata', 'latitude', 'nom_site', ${nom_site}) - 3
notefields with arelevantcondition (${nom_site} != '') to display the retrieved values — noread_onlyattribute set on any note - The 9
calculatefields are placed in a dedicated group withoutappearance: field-list - All other groups use
appearance: field-list
CSV media file: uploaded correctly as a project media file under the exact name sites_pulldata.csv.
What I have already tried
- Removed
read_only: yesfrom allnotefields → error persists - Moved all
calculatefields outside of anyfield-listgroup → error persists - Verified column names in CSV (no spaces, no accents, no special characters)
- Verified UTF-8 encoding of the CSV
My questions
- Is there a known issue with combining
select_one_from_fileandpulldata()in the current version of Enketo / KoboToolbox? - Could the error come from the fact that the CSV is not yet accessible at preview stage (draft form, media file not yet attached to a deployed version)?
- Is there a recommended pattern for displaying
pulldata()results to the user in anotefield without triggering this error? - Does
pulldata()require the form to be deployed (not just in draft) before it can resolve the CSV reference?
Any help or working example would be greatly appreciated. Happy to share the XLSForm and CSV if needed.
Thank you!
