# Relative Referencing with Indexed Repeat in XLSForm

**URL:** <https://forum.getodk.org/t/relative-referencing-with-indexed-repeat-in-xlsform/2945>\
**Category:** Support\
**Created:** [February 19, 2014, 6:48am UTC](https://forum.getodk.org/t/relative-referencing-with-indexed-repeat-in-xlsform/2945 "2014-02-19T06:48:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Collins\_Adoyo](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/collins_adoyo/32/1932_2.png) [@Collins\_Adoyo](https://forum.getodk.org/u/Collins_Adoyo)\
**Post date:** [February 19, 2014, 6:48am UTC](https://forum.getodk.org/t/relative-referencing-with-indexed-repeat-in-xlsform/2945/1 "2014-02-19T06:48:31Z")

</div>

Hi ODKers, I have a form in XLSForm with absolute referencing that seems  
not work.

Please, any idea on the use of relative referencing with the Indexed-repeat  
in XLSforms would be highly appreciated. Attached is the xlsform.

Collins

[xlsform.xlsx](https://getodk.b-cdn.net/uploads/default/original/1X/540055ac873e68aaa2b036caa52230cd243e17d9.xlsx) (26.1 KB)

---

<div class="post-metadata">

**Author:** ![Mitch\_S](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/m/3ec8ea/32.png) [@Mitch\_S](https://forum.getodk.org/u/Mitch_S)\
**Post date:** [February 19, 2014, 6:13pm UTC](https://forum.getodk.org/t/relative-referencing-with-indexed-repeat-in-xlsform/2945/2 "2014-02-19T18:13:50Z")

</div>

On line 29, you have a relevance condition:

${cropname}=30 or ${cropname}=35  
You would replace that with

../cropname=30 or ../cropname=35

because this prompt (cropname\_other) is within the same group (the clu  
repeat group) as cropname.

Furthermore, in your labels, you make reference to ${clu\_name} and other  
values that are specific to each repeat group.  
These will not generate the appropriate text the second time through your  
survey. I am not aware of any way to correct this other than hand-editing  
the generated XML to replace the full path expression, e.g.,

Name of crop/aquaculture on :

with a relative expression

Name of crop/aquaculture on :

> **···**
>
> On Tue, Feb 18, 2014 at 10:48 PM, Collins McAdoyo wrote:
> 
> > Hi ODKers, I have a form in XLSForm with absolute referencing that seems  
> > not work.
> > 
> > Please, any idea on the use of relative referencing with the  
> > Indexed-repeat in XLSforms would be highly appreciated. Attached is the  
> > xlsform.
> > 
> > Collins
> > 
> > ## --
> > 
> > Post: [opendatakit@googlegroups.com](mailto:opendatakit@googlegroups.com)  
> > Unsubscribe: [opendatakit+unsubscribe@googlegroups.com](mailto:opendatakit+unsubscribe@googlegroups.com)  
> > Options: [http://groups.google.com/group/opendatakit?hl=en](http://groups.google.com/group/opendatakit?hl=en)
> > 
> > * * *
> > 
> > You received this message because you are subscribed to the Google Groups  
> > "ODK Community" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [opendatakit+unsubscribe@googlegroups.com](mailto:opendatakit+unsubscribe@googlegroups.com).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> Mitch Sundt  
> Software Engineer  
> University of Washington  
> [mitchellsundt@gmail.com](mailto:mitchellsundt@gmail.com)

---

<div class="post-metadata">

**Author:** ![Friday\_Pharaoh](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/f/67e7ee/32.png) [@Friday\_Pharaoh](https://forum.getodk.org/u/Friday_Pharaoh)\
**Post date:** [October 28, 2016, 3:06am UTC](https://forum.getodk.org/t/relative-referencing-with-indexed-repeat-in-xlsform/2945/3 "2016-10-28T03:06:58Z")

</div>

Hi am struggling with index-repeat () in section A. Where it`s just saying that we may need to use index-repeat() for b17\_main\_purpose question. b17\_main\_purpose is asking about the purposes for growing potato ofsp. But b17 can only come if at A14\_ofsp\_5 one specified that he/she grew ofsp. Where could the problem be?. How do i use the indexed-repeat function in my case

[FTF\_Survey\_27-10-2016.xlsx](https://getodk.b-cdn.net/uploads/default/original/1X/9de983f978bdb88c255a6f3f7a4dda2bde46241d.xlsx) (592 KB)

---

<div class="post-metadata">

**Author:** ![Mitch\_S](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/m/3ec8ea/32.png) [@Mitch\_S](https://forum.getodk.org/u/Mitch_S)\
**Post date:** [November 4, 2016, 6:23pm UTC](https://forum.getodk.org/t/relative-referencing-with-indexed-repeat-in-xlsform/2945/4 "2016-11-04T18:23:19Z")

</div>

See [https://opendatakit.org/help/form-design/#xpath\_expressions](https://opendatakit.org/help/form-design/#xpath_expressions)

> **···**
>
> On Thu, Oct 27, 2016 at 8:06 PM, wrote:
> 
> > Hi am struggling with index-repeat () in section A. Where it`s just saying  
> > that we may need to use index-repeat() for b17\_main\_purpose question.  
> > b17\_main\_purpose is asking about the purposes for growing potato ofsp. But  
> > b17 can only come if at A14\_ofsp\_5 one specified that he/she grew ofsp.  
> > Where could the problem be?. How do i use the indexed-repeat function in my  
> > case
> > 
> > ## --
> > 
> > Post: [opendatakit@googlegroups.com](mailto:opendatakit@googlegroups.com)  
> > Unsubscribe: [opendatakit+unsubscribe@googlegroups.com](mailto:opendatakit+unsubscribe@googlegroups.com)  
> > Options: [http://groups.google.com/group/opendatakit?hl=en](http://groups.google.com/group/opendatakit?hl=en)
> > 
> > * * *
> > 
> > You received this message because you are subscribed to the Google Groups  
> > "ODK Community" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [opendatakit+unsubscribe@googlegroups.com](mailto:opendatakit+unsubscribe@googlegroups.com).  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> Mitch Sundt  
> Software Engineer  
> University of Washington  
> [mitchellsundt@gmail.com](mailto:mitchellsundt@gmail.com)
