Ona search(data) error

I cannot show project data, but here, using the example provided online, this didn't even work. I'm wondering if it's an Ona problem or me? The attached as the survey, the csv, and a screenshot of the error. This is the same error I keep getting with my own data...fruitssurvey.xlsx (23.5 KB)
fruits.csv (70 Bytes)

hi @Amanda_Berman, i think the error is coming from your csv file (fruits.csv). you have combined the name_key with the name making it name_keyname, and the same happens to each fruit in the list, the name_key has to be in one column and the name of the fruit has to be in another column. for instance:
image

try it this way and lets us know if it works.

thanks
fabla2020@gmail.com

I think that was an error that appeared when i uploaded the CSV, they are acutally in different columns...

Okay, I would test it and let you know the outcome

The search appearance/function hasn’t been in Collect for a couple of years now. You can use a regular select if your data set is small or if it is large an external select.

Oh, really!? This is just the select and then cascading!? So if it's large I can try external... But the more recent posts/instructions still have it... I'll take a look. thanks!

hi @Amanda_Berman,
using odk collect v1.11.1, it works with this form. try to load both on the ona server, it should work for you. if you still have problem loading it, please let me know and see how to help figure it out.

fruitssurvey.xlsx (16.2 KB)
fruits.csv (74 Bytes)

thanks.
fabla2020@gmail.com

@Amanda_Berman I see that it is still at http://xlsform.org/ and have filed an issue to remove it at https://github.com/XLSForm/xlsform.github.io/issues/95.

I would start by trying internal selects with cascades as needed (http://xlsform.org/#cascade). These have seen some speed improvements recently so you may find that works well. If it's too slow, you can add _external to your selects to use external choice sets (http://xlsform.org/#external).

@Fabla It depends what you are trying to achieve. That form will work because there is indeed a search appearance. What the search appearance does is let the user search through possible choices. Read more about it at http://docs.opendatakit.org/form-widgets/#select-with-search-widget. You can also use the autocomplete appearance for the same behavior.

@Amanda_Berman's usage where search has an argument (search('fruits')) suggests this is not what she was trying to do. At some point there was a function that could go in the appearance column that was also called search. Its argument would act something like a choice-filter. This is an odd construct and seemed to get removed pretty quickly but I don't know the history.

@LN and @Fabla Thanks os much for all your help!

1 Like

Thinking a little more about this I realize both the search appearance and the search() appearance-function are being invoked at the same time. That said, I still strongly recommend avoiding the appearance-function if you can and I do think we should remove it from official documentation.