When dealing with a CSV having a single column (with or without a final comma on each row), pulldata() does not work.
Example of use case: I want to check an entered value against a huge list but I don’t want the user to be able to see all the list (so no big.select_one, whether with search appearance or not. It will even be safer with hashes the day Enketo implements the function digest().
If I change the file to contain:
then the exact same pulldata(‘items’, ‘item_key’, ‘item_key’, ‘item_1’) will return ‘item_1’, as expected.
Steps to Reproduce
Upload as “media” the file ‘items.csv’, containing only:
Make a form with
- a calculate field named ‘calc’ containing:
pulldata(‘items’, ‘item_key’, ‘item_key’, ‘item_1’)
- a note field containing
Launch the date collection (Enketo, online): the note field will show no pulled data.
update the file ‘item.csv’ to:
Redeploy and relaunch Enketo, the note field will display:
Enketo able to pull data from a single-column CSV file
Enketo not able to pull data from a single-column CSV file