Using the search() function - issues in the syntax

Hi everyone,
hope you all are safe and well during this pandemic.
I am required to pull a set of choices from an external csv file, for creating a select_one question in my form. I came across the ‘search()’ function with the following syntax :

search(csv file, ‘matches’, column name to be searched in csv file, text to be searched in that column, name of filtering column in csv file, text to filter the column)

I have 2 queries here:

  1. In my project, I don’t need any text to be searched in the column. If my filtering criteria filters 10 rows of data, I would require all 10 rows to come as choices in my form. Is this possible? I have tried by excluding parts of the syntax I do not need, but this does not seem to work
  2. Can multiple columns be filtered with different filtering criteria?

Could someone get back at the earliest on this?
Thanks in advance,
Varun

Hi @Varun,

If this is your requirement, would you mind having a look at Select one or many from external file question type. It should solve your issue.

Have a great day!

Thanks for the super prompt response Kal, @Kal_Lam
While this is great to pulldata from an external file it would help if you could elaborate on the following:

  1. Lets say in this example on fruits, I have additional columns of interest (country and region of production). When the user selects the country/region, then they should be displayed with a filtered list of fruits from that particular region
    Could you show how to do this using the example you shared?

  2. I work with enumerators in rural areas where internet connectivity is a challenge. You mentioned this would only work on Enketo? Has there been an update on this? would it work on kobocollect as of now>?

1 Like

Hi @Varun,

I finally understood your requirement.

Regarding your first query:

You could have a look at post discussed previously. It has a small workaround and should solve your issue.

Regarding your second query:

Yes, it can be collected in KoBoCollect android app as well but try using the latest version. The earlier version should not support.

Have a great day!

1 Like