Make a selection from a roster created from groups rather than repeats (alternative to select_one ${repeat})

Book2.xlsx (15.3 KB)

Hi all,

I have 3 children in the roster and two of them were <=10 age(i.e one child=7 & second child=2).
What I want is I want to fetch from the above roster--- child whose age is <=10 and I want to chose from the two by ticking the name. Is there a way for this? Please help me!

Here i attached my xls

Thank you
Yo

Hi @YO
I think you should make the process more automated and use repeats to collect as many children as you want. Then you can build a select_one/multiple question based on such repeat group and even add a condition (age in your case) as you wanted to filter options.
Here is a sample form:
children.xlsx (7.0 KB)

Thank you! But, I dont want to use begin repeat because when i export it it will be in external excel. So i need by begin group is there a way for this?

What do you mean by "fetch"? Is there a list of children already?

my solution was universal. Are you sure you will always have children and always 2 of them will be <=10 or maybe it was just an example?

I need only 5 children....i just attached 2 child only as an example

Generally, it is possible to build choices from such questions and it would look like:
Book2.xlsx (7.7 KB)
but I'm not sure if it's possible to filter them to get only those with age < 10.

Thank you so much! The name come up, but like u said it doesn't filter those with age < 10.

I tried adding choice_filter like Book2.xlsx (8.0 KB) but it doesn't work, Maybe @LN you are more experienced in filtering and could tell us if it's something that should work?

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.)

2 Likes