# Make a selection from a roster created from groups rather than repeats (alternative to select\_one ${repeat})

**URL:** <https://forum.getodk.org/t/make-a-selection-from-a-roster-created-from-groups-rather-than-repeats-alternative-to-select-one-repeat/32466>\
**Category:** Support\
**Tags:** form-design\
**Created:** [February 17, 2021, 9:19am UTC](https://forum.getodk.org/t/make-a-selection-from-a-roster-created-from-groups-rather-than-repeats-alternative-to-select-one-repeat/32466 "2021-02-17T09:19:52Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![YO](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/y/3ab097/32.png) [@YO](https://forum.getodk.org/u/YO)\
**Post date:** [February 17, 2021, 9:19am UTC](https://forum.getodk.org/t/make-a-selection-from-a-roster-created-from-groups-rather-than-repeats-alternative-to-select-one-repeat/32466/1 "2021-02-17T09:19:52Z")

</div>

[Book2.xlsx](https://forum.getodk.org/uploads/short-url/rkd3zhDf7bi8dWuluD0G6h8qJ6U.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

---

<div class="post-metadata">

**Author:** ![Grzesiek2010](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/grzesiek2010/32/2881_2.png) [@Grzesiek2010](https://forum.getodk.org/u/Grzesiek2010)\
**Post date:** [February 17, 2021, 9:47am UTC](https://forum.getodk.org/t/make-a-selection-from-a-roster-created-from-groups-rather-than-repeats-alternative-to-select-one-repeat/32466/2 "2021-02-17T09:47:23Z")

</div>

Hi @YO  
I think you should make the process more automated and use [repeats](https://docs.getodk.org/form-repeats/) to collect as many children as you want. Then you can [build a select\_one/multiple question based on such repeat group](https://forum.getodk.org/t/generate-multiple-choice-alternatives-based-on-the-answers-in-a-repeat/10269) and even add a condition (age in your case) as you wanted to filter options.  
Here is a sample form:  
[children.xlsx](https://forum.getodk.org/uploads/short-url/hKtvyB0VbPEtTym0Ktr9V91mQug.xlsx) (7.0 KB)

---

<div class="post-metadata">

**Author:** ![YO](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/y/3ab097/32.png) [@YO](https://forum.getodk.org/u/YO)\
**Post date:** [February 17, 2021, 11:39am UTC](https://forum.getodk.org/t/make-a-selection-from-a-roster-created-from-groups-rather-than-repeats-alternative-to-select-one-repeat/32466/3 "2021-02-17T11:39:09Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![awaafo\_donald](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/awaafo_donald/32/1660_2.png) [@awaafo\_donald](https://forum.getodk.org/u/awaafo_donald)\
**Post date:** [February 18, 2021, 4:13pm UTC](https://forum.getodk.org/t/make-a-selection-from-a-roster-created-from-groups-rather-than-repeats-alternative-to-select-one-repeat/32466/4 "2021-02-18T16:13:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Grzesiek2010](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/grzesiek2010/32/2881_2.png) [@Grzesiek2010](https://forum.getodk.org/u/Grzesiek2010)\
**Post date:** [February 19, 2021, 12:37pm UTC](https://forum.getodk.org/t/make-a-selection-from-a-roster-created-from-groups-rather-than-repeats-alternative-to-select-one-repeat/32466/5 "2021-02-19T12:37:55Z")

</div>

> [@YO](#):
>
> 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?

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?

---

<div class="post-metadata">

**Author:** ![YO](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/y/3ab097/32.png) [@YO](https://forum.getodk.org/u/YO)\
**Post date:** [February 20, 2021, 1:21pm UTC](https://forum.getodk.org/t/make-a-selection-from-a-roster-created-from-groups-rather-than-repeats-alternative-to-select-one-repeat/32466/6 "2021-02-20T13:21:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Grzesiek2010](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/grzesiek2010/32/2881_2.png) [@Grzesiek2010](https://forum.getodk.org/u/Grzesiek2010)\
**Post date:** [February 22, 2021, 10:57am UTC](https://forum.getodk.org/t/make-a-selection-from-a-roster-created-from-groups-rather-than-repeats-alternative-to-select-one-repeat/32466/7 "2021-02-22T10:57:21Z")

</div>

Generally, it is possible to build choices from such questions and it would look like:  
[Book2.xlsx](https://forum.getodk.org/uploads/short-url/i1fGBt2V3Yi2XE3O204XG2RKmy9.xlsx) (7.7 KB)  
but I'm not sure if it's possible to filter them to get only those with age \< 10.

---

<div class="post-metadata">

**Author:** ![YO](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/y/3ab097/32.png) [@YO](https://forum.getodk.org/u/YO)\
**Post date:** [February 22, 2021, 1:47pm UTC](https://forum.getodk.org/t/make-a-selection-from-a-roster-created-from-groups-rather-than-repeats-alternative-to-select-one-repeat/32466/8 "2021-02-22T13:47:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Grzesiek2010](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/grzesiek2010/32/2881_2.png) [@Grzesiek2010](https://forum.getodk.org/u/Grzesiek2010)\
**Post date:** [February 22, 2021, 2:59pm UTC](https://forum.getodk.org/t/make-a-selection-from-a-roster-created-from-groups-rather-than-repeats-alternative-to-select-one-repeat/32466/9 "2021-02-22T14:59:47Z")

</div>

I tried adding choice\_filter like [Book2.xlsx](https://forum.getodk.org/uploads/short-url/1NRmRRnmUaVtCDdEC5kcL310XAe.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?

---

<div class="post-metadata">

**Author:** ![LN](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/ln/32/1605_2.png) [@LN](https://forum.getodk.org/u/LN)\
**Post date:** [February 23, 2021, 10:34pm UTC](https://forum.getodk.org/t/make-a-selection-from-a-roster-created-from-groups-rather-than-repeats-alternative-to-select-one-repeat/32466/10 "2021-02-23T22:34:28Z")

</div>

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](https://forum.getodk.org/t/proposal-customize-name-and-label-columns-in-selects-from-external-data-in-xlsform/27265/8), 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.)
