I have a cascading select for locations and sub-locations. Not all locations have a sub-location and if that is the case, I want to use relevant to hide the sub-location question. Is there a way to do this?
I tried what is described in the post linked below, but it seems to always count the total number of sub-location options, not the length of the filtered list. count_filtered_cascade_options.xlsx (16.2 KB)
BTW, now that all choice lists in XLSForms are converted to nodesets (see https://github.com/XLSForm/pyxform/pull/614) there is no longer any need for circa 2019 'tricks' to accomplish this.
So as @ahblake most astutely states, you just need to perform a little XPath 'black magic' to include the equivalent cascading select filter into your count() input nodeset. Yes it is a bit obscure, but there is tremendous (hidden) power in these XPath expressions that let you accomplish magical things like this!