ODK Collect issues while pulling datas from CSV

1. What is the problem? Be very detailed.
Hey there,

I have to survey households who are members of cooperatives. I previously manually registered the names of all the members of these coops, with other information like their localization (districts > communes > villages) in the db_bnf. I now want the surveyors to select the members in a list, restricted thanks to the localization. As I have more than 2500 entries in the db_bnf, I don't want to copy/paste it directly in my choice sheet. So I put it in a CSV (an sample is attached) download it with my xlsform on Aggregate and pulled the data in Xlsform with the pulldata() function (please see the attached file). I then use cascading select_one to reduce the list of beneficiaries.

The importation goes well, but when I go on my mobile device to try it, I have the following error :
For each column called, I have the message error "No such table: externalData (Sqlite code 1): ,while compiling, : SELECT c_district FROM externalData, (OS error - 2: No such file or directory)

It's the same for the c_op, c_id-commune, c_commune etc.

Could you help me understand my mistakes?

Thanks,
Julien
bd_bnf.csv (219 Bytes)

sample_xlsform.xlsx (14.2 KB)

2. What app or server are you using and on what device and operating system? Include version numbers.
Aggregate 1.7.3
Collect 1.21.2

Hi @Julien_GM

your xls form contains many problems and ca't be converted using http://opendatakit.org/xlsform/ the csv file doesn't seems good as well. If you want someone to help you please just attach a form that we can use for testing.
When it comes to pulling data from csv file you can find more info and a sample form here: http://xlsform.org/en/#dynamic-selects-from-pre-loaded-data I think it should help you.

Hi @Grzesiek2010 thanks for your fast answer. You'll find the corrected files here:sample_xlsform.xlsx (17.8 KB)
bd_bnf.csv (607 Bytes)

Thanks for the link, I read it at least ten times these past two days trying to understand my mistakes. I also searched on this forum and on ona. I found this example that helped me a lot.

Thanks again,
Julien

Your csv file doesn't seem good.
First off all remove those not needed ".
Then please take a look at this sample:



to understand the format.

If you want to get items for:
select_one op where name: id_op, label: op
your csv file should be like:

id_op,op
mango,Mango
oranges,Oranges
strawberries,Strawberries

Thank you @Grzesiek2010, it's finally working. I just splitted my CSV in 3 files to make things easier to interprete.

If I may give some non computer specialist feelback, I think that the example you gave me is not that good. The 'fruits' is the CSV, the question's name and the choice_list. In my opinion it would be much easier to understand if there were three different names!

Julien

1 Like