The problem isn't with the choice filter, it's with the age
column in the choice list. You can use a value from the form as a choice label because label text is dynamically evaluated. However, you can't use a value from the form as a choice name or other property name.
As @Grzesiek2010 describes, what you're trying to do is possible with repeats. If you're not comfortable using repeats, you could have a final question for each child that means your age criteria that says something like "Pick this child?" with a constraint that makes sure only one is picked. You could also have multiple questions after the roster has been created that look like "Pick ${c_1a}? Yes/No", etc. You can use relevance to hide the children you don't want picked and use a constraint to ensure only one is picked.
(For XPath enthusiasts, once we introduce local-name()
as described in Proposal: customize name and label 'columns' in selects from external data in XLSForm - #8 by LN, we would be able to build an itemset with an expression like starts-with(local-name(), "ch")
if all child nodes of ch1
, ch2
, etc have identical names. I doubt we'd expose this in XLSForm, though.)