I have 100 districts and 3000 related villages behind these districts. The villages list is shortlisted automatically based on the selection in DISTRICT dropdown, using choice_filter. Now, I need to add 'OTHER' as an option in the villages list, to cover the villages which may not be present in the list, and I am subsequently giving an open text field to enter the name when OTHER is selected in villages dropdown. It seems that I have to enter OTHER as village option at least 100 times, once for each district. Is there a simpler programmable way of handling this?
In the options of villages, add at the very last a value I.e 9999 as other
And for the choice-filter use district = ${district_value} or name = 9999 where district is the column that holds the filter options. In case you attach the list as csv, the same is done by referencing columns in choices and adding one option for other on the same list_name
Don't I have to enter OTHER option in the list of villages 100 times, by what you are suggesting? The OTHER option is not going to get listed in 100 different villages choices unless it is defined there. No?
Jules suggestion would allow you to just write it once.
As the choice filter contains an "or", it means that the OTHER option will not be filtered by district or any other administrative area. In this case the OTHER is selected by filtering the name column and no other columns. It is a very good solution to this problem.
Haven't tried this solution before, have gone the route of repeating "other" multiple times. Will definitely be trying this out and implementing in future! Thanks for the question @Saad and the response @jules_rugwiro!
Best guess is, all values in name should be of same data-type otherwise, you can assume all of them are text and change the choice-filter() value to district = ${district_value} or name = 'other'
In my previous response 9999 was a representation of any value you would choose to be other and if not a number, then quote it out