onaio / onadata

Collect, Analyze and Share
https://ona.io
Other
182 stars 131 forks source link

Field names starting with underscores are ignored during CSV import #2582

Open kelvin-muchiri opened 2 months ago

kelvin-muchiri commented 2 months ago

Environmental Information

Problem description

During a CSV import, any field name starting with an underscore e.g _name is ignored during CSV import.

Expected behavior

Field names starting with an underscore should not be ignored during CSV import and data should be available for those fields

Steps to reproduce the behavior

  1. Create a form that has field names starting with underscores.
  2. Make submissions to the form
  3. Export the submissions into a CSV and edit the submissions.
  4. Import the CSV edited in the previous step. You will notice the fields whose names starts with an underscore will have no values

Additional Information

It's valid for field names to start with an underscore as per the xlsform.org documentation but unfortunately, when parsing the CSV for import, we make the assumption that any field starting with an underscore is a metadata field and ignore them