# Indexed-repeat repeat group

**URL:** <https://forum.getodk.org/t/indexed-repeat-repeat-group/25266>\
**Category:** Support\
**Tags:** odk-xlsform\
**Created:** [March 4, 2020, 3:26am UTC](https://forum.getodk.org/t/indexed-repeat-repeat-group/25266 "2020-03-04T03:26:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Alberto\_Diaz](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/daniel_alberto_diaz/32/9482_2.png) [@Daniel\_Alberto\_Diaz](https://forum.getodk.org/u/Daniel_Alberto_Diaz)\
**Post date:** [March 4, 2020, 3:26am UTC](https://forum.getodk.org/t/indexed-repeat-repeat-group/25266/1 "2020-03-04T03:26:05Z")

</div>

\*\* 1. What is the problem? Be very detailed. \*\*

I can't use the relevant function because the index-repeat fails

\*\* 2. What application or server are you using and on what device and operating system? Include version numbers. \*\*

ODK Central 0.7  
Android 7 - Motorola G7

\*\* 3. What have you tried to solve the problem? \*\*

Declare the variable before executing the repeat but it did not work.

\*\* 4. What steps can we take to reproduce the problem? \*\*

The error occurs when I want to use the relevant function in a field. Example: f18 fm\_pregnant, I must enable this question if it is female sex and under 10 years old. Placing the relevant filter gives me an error.

\*\* 5. Anything else we should know or have? If you have a test form or screenshots or records, attach below. \*\*  
[test.xlsx](https://forum.getodk.org/uploads/short-url/fJNkuhIg1LTVtDtxj6BsvTKmHqG.xlsx) (9.4 KB)

---

<div class="post-metadata">

**Author:** ![Daniel\_Alberto\_Diaz](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/daniel_alberto_diaz/32/9482_2.png) [@Daniel\_Alberto\_Diaz](https://forum.getodk.org/u/Daniel_Alberto_Diaz)\
**Post date:** [March 4, 2020, 1:52pm UTC](https://forum.getodk.org/t/indexed-repeat-repeat-group/25266/2 "2020-03-04T13:52:35Z")

</div>

The error occurs when I go to the modules. I need to take members variables, age, gender. Then use these variables as relevant or constraint for question validations. That's where I get the error.

 ![661231fe-cb65-47b0-be72-1a22045f53b9](https://getodk.b-cdn.net/uploads/default/original/2X/5/5348ec1d509d078ce279a3669f3e03116127698c.jpeg)

Can someone help me please?

---

<div class="post-metadata">

**Author:** ![Daniel\_Alberto\_Diaz](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/daniel_alberto_diaz/32/9482_2.png) [@Daniel\_Alberto\_Diaz](https://forum.getodk.org/u/Daniel_Alberto_Diaz)\
**Post date:** [March 8, 2020, 9:20pm UTC](https://forum.getodk.org/t/indexed-repeat-repeat-group/25266/3 "2020-03-08T21:20:55Z")

</div>

any suggestions? some help? I'm stuck and I need to make this work. I am grateful if anyone could help me. Thank you

---

<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:** [March 10, 2020, 10:34am UTC](https://forum.getodk.org/t/indexed-repeat-repeat-group/25266/4 "2020-03-10T10:34:40Z")

</div>

According to the error message returned after converting:

> The problem was located in Relevant expression for ${fm\_pregnant}

in that row (18) you have `${gender} = 'F'` where you refer ${gender} from another `repeat_group`. That means you need to use `indexed-repeat` like you do in calculations for example.

---

<div class="post-metadata">

**Author:** ![Daniel\_Alberto\_Diaz](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/daniel_alberto_diaz/32/9482_2.png) [@Daniel\_Alberto\_Diaz](https://forum.getodk.org/u/Daniel_Alberto_Diaz)\
**Post date:** [March 10, 2020, 7:48pm UTC](https://forum.getodk.org/t/indexed-repeat-repeat-group/25266/5 "2020-03-10T19:48:42Z")

</div>

Exactly, I need to use the member data to validate questions that I will then ask in modules one, two, three etc. How to be gender and age. But I can't find a way to declare the variable so that it doesn't fail. Any suggestions?

---

<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:** [March 11, 2020, 12:11pm UTC](https://forum.getodk.org/t/indexed-repeat-repeat-group/25266/6 "2020-03-11T12:11:56Z")

</div>

You just need to the same what you did with indexed-repeat..., ok here is your updated form, I highlighted in red what I added. Please test it.  
[index.xlsx](https://forum.getodk.org/uploads/short-url/lc5MqxaDQf4R9Bq1xaPmqp7NY6Q.xlsx) (8.1 KB)

---

<div class="post-metadata">

**Author:** ![Daniel\_Alberto\_Diaz](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/daniel_alberto_diaz/32/9482_2.png) [@Daniel\_Alberto\_Diaz](https://forum.getodk.org/u/Daniel_Alberto_Diaz)\
**Post date:** [March 11, 2020, 1:48pm UTC](https://forum.getodk.org/t/indexed-repeat-repeat-group/25266/7 "2020-03-11T13:48:41Z")

</div>

hi @Grzesiek2010  
Thank you very much for your help. I didn't realize to declare the complete variable as index-repeate. You always learn something new or you can ignore it. Thanks again for your time and help!
