Relevance outside a repeat group

What is the problem? Please be detailed.
Hello ODK community, I am trying to set a relevance for a question outside a repeat group, whose appearance will depend on the choices selected within a preceding repeat group. I get an error that I need to use indexed repeat to specify which value I want. I attach a test_index.xlsx (11.2 KB)
form and will appreciate any help
Thanks a lot
What ODK tool and version are you using? And on what device and operating system version?

What steps can we take to reproduce the problem?

What you have you tried to fix the problem?

Anything else we should know or have? If you have a test form or screenshots or logs, attach here.

hi @mugambii in your sample form, this question "5.1a What were the main pest problems on tomato during last season " create the repeat group, so if more then answer option is selected for this question, the system will not be able to tell which one you are referring to in this question "5.3 How many different bio-pesticide types did you use in the last season?", so you can put this question inside the repeat group and change the relevance to ${intvlast} = 1, so the for each question selected in question 5.1a, the question 5.3 will appear in the repeat group if you select option 1 in question 5.1c for all those you choose in question 5.1a.

Thanks a lot @Fabla. The question 5.3 is however the beginning of another repeat group i.e respondents who used biopesticides - and will repeat a series of 18 questions as many times as the number of biopesticides used (I re-attach sample file with 3 questions, as an example).
That's why I wanted to have this biopesticide question as a stand-alone group outside the pest_rpt group., and create its relevance by referencing the pest_rpt group using index-repeat but I don't know how to create the syntax for that. Your assistance is highly appreciated. test_index.xlsx (11.8 KB)

Hi @mugambii, try this sample find and lets see, i didn't get time to test it but i believe this syntax should work for you now, let me know if it does or it doesn'ttest_index_revised.xlsx (12.7 KB)


Thanks so much perfectly!

1 Like