Cascade Select External multi-CSV file

Hi Everone,

I have four CSV file( district, sub-district, community, governorate) linked together using ID
for Example:
in the sub-district file, there is a district_id column.
My question is how can I link it together in ODK form using cascading select_one external file.

Your support is highly appreciated.

Hi @moh1993net
have you investigated the documentation https://xlsform.org/en/#cascading-selects? There you can find a sample form as well.
If there is something you don't understand please ask or as a last resort attach your files maybe we can help.

1 Like

Thanks @Grzesiek2010,
I have solved this issue by using search function.

That's great. If it's possible please share your solution, it might help someone else in the future.

1 Like

Dear @Grzesiek2010,

I will do that once the form ready to use, as I have another issue that you may help solve it.
How can I add (Other) value if it's not listed in the drop down list. I tried use or_other in type column with select_one but after use the form I faced an issue: ( no such column: c_other in the externaldata (code 1)).

Your support is highly appreciated.

Best,

that option doesn't work with external csv files so you need to add that other option manually to the list of your options.

Thanks for support @Grzesiek2010,

How can I add it manually, as I use search option for id of sub_district inside communities csv file

I mean just as a last option to your csv file. For example if you have options like:

  • Orange
  • Blue
  • Green

You need to add

  • Other

as well.

@Grzesiek2010,

But the search function does not return (Other) option, as it compare the id of sub_districts with the sub_district_id inside communities csv file, so it will not find Other option as there is no id for it inside sub_districts csv file

Ok it's a more complex case and I'm not even sure if it's doable...
The search function looks like:
search('filename', 'option', 'columnName', 'value')
where available options are:

  • startswith
  • endswith
  • contains
  • matches

and there is no way to use alternation like id or other for the value parameter.

@Xiphware and @LN are experts when it comes to fancy complex forms so maybe they can help?