Select to view content in your preferred language

Question visiblity if 1 of 3 values are chosen out of 5 possible

469
2
08-15-2025 04:48 PM
AbraKaiser
Occasional Contributor

I'm designing a survey in Survey123 connect, and I have a series of questions that I'd like to be visible if one of 3 options out of a total of 5 options are selected in a previous question. 

Example: Question 1 is a choose 1 of apples, oranges, strawberries, blueberries, and mango.

I'd like question 2 to be visible if either appes, strawberries or mango are chosen.

I tried the (selected(${question1}, 'apples') or selected($question1}, 'strawberries') or selected(${question1}, 'mango')) in the ESRI::Visible column but it didn't work. I didn't get any error messages in Survey123 connect, my questions just didn't show up.

What am I missing? Is there a way to write it kind of like Python, If question1 IN ('apple', 'strawberry', 'mango') then make visible?

0 Kudos
2 Replies
ChristopherCounsell
MVP Frequent Contributor

First - check case sensitivity.

Second, 'IN' type list checks aren't supported. You have to use the painful nested if statements. However you can use regex to check e.g. this should work:"

regex(${question1}, '^(apple|strawberry|mango)$')

Third, I think the way you're meant to do it is:

  • ${question1} = 'apple' or ${question1} = 'strawberry' or ${question1} = 'mango'
  • or using nested ifs:
  • if(${question1} = 'apples', true, if(${question1} = 'strawberries', true, if(${question1} = 'mango', true, false)))

I think it's just the way the logical boolean operators get handled with how you have it set up.

Neal_t_k
Frequent Contributor

I think you are missing your "{" bracket here:

Neal_t_k_0-1755545045958.png

Otherwise your logic should work.