Show label of indexed-repeat numerical variable

Kobo question.xlsx (28.6 KB)

I have been reading the Kobo ccommunity and it is very helpful. However, I could not find a possible solution for my issue. Attached, please find the sample XLSForm I am working on.

I managed to make indexed-repeat work for a numerical variable, however, what I would like to show is not the numerical code but the label of the numerical code.

Grateful for your help.
With best regards,

@joe.alpuerto, this post discussed previously should help you solve your issue:

Design hint: Test the 2nd repeat reference for moving back and deleting a case in the first repeat. The references might get mixed-up.


You may need to control this by packing the content in the second repeat in a group controled by a relevant.

Thank you, walroos and Kal_Man.
The indexed-repeat works fine except that it takes the numeric code (of crop) as output. However, what I wanted to output is the label (of crop code).
Below code works fine:

However, when I put together the jr:choice-name with indexe- repeat codes, it doesn’t seem to work:

Thank you.

I finally got it! The issue was that jr:choice-name() cannot be combined with indexed repeat. I added a new calculate step for jr:choice-name() in the first repeat which will be called in the indexed repeat code in the second repeat.

Attached, the code for those who might be looking for answers.

Many thanks for the insights,

Kobo question.xlsx (28.5 KB)

1 Like