Auto-selecting option based on previous response

Hello, I would like to request your help to figure out a bit complex calculation in KoBo collect form builder. for example, question-1 is “name of the village”, where village will be selected from a list of 10 villages. Now, question-2 is “Does the village has electricity connection?”, where yes/ no responses will be collected.

Now, If village 1-5 are selected in question-1, then I want to automatically record “yes” in question-2; and if village 6-10 are selected, then I want “no” to be automatically recorded in question-2. I have been trying so many ways to do but couldn’t succeed. could anyone please help on this and guide me how I can do this?

Welcome to the community, @deep! You could do this as outlined in the post discussed previously:

1 Like

Hi, thank you so much for sharing this. This will surely be immensely helpful.

However, there is something I would like to confirm with reference to your reply. Let’s say, I have 50 choices in question-1, and I want “yes” to be automatically selected in question-2 if any of the first 30 choices in question-1 is selected. Similarly, I “no” should be automatically selected in question-2, if any of last 20 choices in question is selected.

Now, instead of listing all 50 options as IF(${Q1}=‘1’, or ${Q1}=‘2’, or ${Q1}=‘3’…… and so on, can I simply write the code as IF(${Q1}=‘1-30’,1,IF(${Q1}=‘31-50’,2))??? would that work??? Or is there a better way available to do this??? Can you please guide on how to implement this code in a simpler way for a question that has large number of options?

Thanks again.

@deep, if you do it that way it should take a very long time, and your expression may be exposed to errors. You could thus do it as outlined in the post discussed previously: