Selections in select one based on some previous selection

Hello All.

I am designing a form to collect information about Jungle & Pet animals, in a repeat group.

I have a repeat count of 3 for this repeat group.
My select_one type has choices :- Jungle, Pet.
My select_one animal has choices :- Lion,Tiger,Elephant,Cat,Dog.

What I need, that, if I select "Jungle" in select_one type, and then Cat, Dog in select_one animal, then collect should throw constraint message as not acceptable and if I select animal as Lion etc, it should go to the next question, and also conversely.

My list of animals may extend at the most 10 choices.
How to handle such constraints between select_ones?

Will anybody help, please.

Thanks and regards.

Hello

I am currently working on a similar issue.

Rather than having a constraint to throw a message on an invalid value, you can use the "relevant" field. This means, that based on the selection in "type", you will display a list of valid value for "animal".

Are you using ODK Build?
You shoud add two choseOne questions for animal, but only one will be displayed at a time (depending on value in type)

Lets say you add one called 'Jungle', then you should add to the advanced field relevance "selected(/data/type, 'Jungle')" without the "".

And lets say you add one called 'Pet', then you should add to the advanced field relevance "selected(/data/type, 'Pet')" without the "".

For the ChooseOne called Jungle you will add the following options: Lion, Tiger, Elephant.
For the ChooseOne called Pet you will add the following options: Cat, Dog

This will result in only the valid options are displayed based on selection of type.

Cheers.

ยทยทยท On Monday, August 24, 2015 at 11:37:17 PM UTC+5:45, Praxis NFP wrote: > Hello All. > > I am designing a form to collect information about Jungle & Pet animals, in a repeat group. > > I have a repeat count of 3 for this repeat group. > My select_one type has choices :- Jungle, Pet. > My select_one animal has choices :- Lion,Tiger,Elephant,Cat,Dog. > > > What I need, that, if I select "Jungle" in select_one type, and then Cat, Dog in select_one animal, then collect should throw constraint message as not acceptable and if I select animal as Lion etc, it should go to the next question, and also conversely. > > My list of animals may extend at the most 10 choices. > How to handle such constraints between select_ones? > > Will anybody help, please. > > Thanks and regards.