Hi, I'm using Survey123 version 3.12.232
Within my survey, I have a multiple choice question ("plant species") within a repeat. Outside of the repeat, I have a unique question for each plant species's seed weight. I want a species specific weight question to be visible if a certain species was selected across all the repeats.
My problem is, the weight questions (outside the repeat) only appear depending on which repeat I am looking at in the form view of Survey123 Connect. If I am looking at one repeat, the species weight questions are appearing for ONLY the answers selected in that repeat. If I look at another repeat, same thing.
How do I make all the relevant questions outside the repeat appear, based on the answers across ALL the repeats?
Solved! Go to Solution.
Join can take all the values from the repeat question and return a single string.
join(',', ${question_in_repeat})
After that, you can use contains to look for specific values.
contains(${question_one}, 'some species')
I think you would have to count them up and then compare to the number of repeats.
In each repeat do a if(contains(species), 1, 0). Then outside compare count(speciescount) to a count of the repeat (using max(position) or count(any repeat filed).
You could also do if(contains(species), yes, no). Then your relevant is not(contains(no)) on a field that is join(IfYesNoFieldAbove).
Hope that makes sense.
Join can take all the values from the repeat question and return a single string.
join(',', ${question_in_repeat})
After that, you can use contains to look for specific values.
contains(${question_one}, 'some species')
Thank you both! I tried @jcarlson 's solution because it was simpler, and it worked well.
A join and contains would tell you if the species is in any repeat. You said you want it if it is in all repeats. Totally different.