1. What is the issue? Please be detailed.
i am trying to preload choices using an external csv file as an attachment and i get just the drop down with no choice, i am using this syntax .
search('facilities_data')
search('facilities_data', 'matches', 'state', ${state})
search('facilities_data', 'matches', 'lga', ${lga})
search('facilities_data', 'matches', 'ward', ${ward})
search('facilities_data', 'matches', 'ward', ${ward})
and yet i can't get to see any choices 2. What steps can we take to reproduce this issue?
upload the final version of the programmed xlsx and also the csv for attachments
3. What have you tried to fix the issue?
i have tried to upload and also use documentations to practice yet nothing 4. Upload any forms or screenshots you can share publicly below.
Some edits done here. Tested and confirmed functional for all the aforementioned select_one fields.
One of the key issues identified was putting applying the search external file function on the state and at the same time including list of state names in the choices sheet. In this case, I remove state entries on choices sheet and used the state in the external file. Innovius_Facility_dummy.xlsx (16.6 KB) facilities_data.csv (838.0 KB)
@Francis_Opiyo I just ran the form upload, but I couldn't attach the CSV because it said "This definition requires no attachments, so there is nothing to upload" so i can't upload the attachements is there a reason why this is so?. Just wanting to make sure i get it right
Apologies I tested with ODK aggregate. I did not have access to any ODK central instance. A quick question though, Were you able to upload seamlessly before?
I see you are not referencing the external csv files. Can you make the select one to point to this; select_one_from_file facilities_data.csv and then add the "parameters" column then for the row of lga insert in the cell "value=lga_code, label=lga" Do the same for ward "value=ward_code, label=ward" and hf_name "value=hf_name_code, label=hf_name" (adding the code and label appropriately). If necessary include allow_choice_duplicates to yes in the setting. I hope this will help. But it is strongly suggested to make facilities_data an entity to enjoy the efficiency that comes with this. Let me know if you succeed.
Thank you but a quick question to ensure i understand what you mean, i should maintain the lines of syntax on appearance while using select_one from_file? and how do i make the csv an entity ? thanks
I've included a working GIF example of it in action here:
Do note that search() is deprecated and will likely be removed in the future. The select_one_from_file is the recommended solution. Also, search()will not work in the web-based data collection forms. This is why you must use a phone to test it (as my GIF shows). If you plan on using web forms, please use a supported solution.
As @Francis_Opiyo stated, the issue with your original version was two-fold:
You were using "state_code" to filter the data, but filtering on the "state" column. I have modified my form to filter on "state_code", but you could easily switch it to filter and keep "state" instead, assuming your "state" names are all unique. I personally always use a unique ID that I can map back to the names because names can sometimes be surprisingly not unique.
You had multiple lists named "state" in the "choices" worksheet, which led to the confusing errors. Removing those cleaned it up and helped identify the real issue in (1).
Thank you this worked on the device, but didn't on the web, i would send these version for the device for review and figure a way for it to work on the web. @jniles