TypeError: Cannot read properties of null (reading 'textContent') — select_one_from_file + pulldata() — form in draft

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: pages in the settings sheet
  • 1 field select_one_from_file sites_pulldata.csv (external CSV, 345 rows, UTF-8, first column = nom_site)
  • 9 calculate fields using pulldata() to retrieve attributes from that CSV:
    pulldata('sites_pulldata', 'latitude', 'nom_site', ${nom_site})
  • 3 note fields with a relevant condition (${nom_site} != '') to display the retrieved values — no read_only attribute set on any note
  • The 9 calculate fields are placed in a dedicated group without appearance: 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

  1. Removed read_only: yes from all note fields → error persists
  2. Moved all calculate fields outside of any field-list group → error persists
  3. Verified column names in CSV (no spaces, no accents, no special characters)
  4. Verified UTF-8 encoding of the CSV

My questions

  1. Is there a known issue with combining select_one_from_file and pulldata() in the current version of Enketo / KoboToolbox?
  2. 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)?
  3. Is there a recommended pattern for displaying pulldata() results to the user in a note field without triggering this error?
  4. 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!

@abdelmich Welcome to the forum!

Thank you for providing those details, they really help us better understand what might be going on.

If possible, could you please share your XLSForm?