Select to view content in your preferred language

How to make conditional questions in connect?

6465
3
12-01-2022 12:01 PM
cole_KTB
Occasional Contributor

Hey there,

I am newer to using Xls forms with Connect to make surveys. I want to make an additional question to appear in the survey upon the user selection a certain option in a multiple choice Q. Else wise I would like for this to remain hidden. 

I came across this: if(condition, a, b) If the condition evaluates to true, returns a; otherwise, returns b.

This could probably work for my purposes, but I do not know which column to implement this code in, nor how to set a & b values appropriately. 

Thanks in advance for any help you may be able to provide! 

Tags (2)
0 Kudos
3 Replies
jcarlson
MVP Esteemed Contributor

That is the function of the relevant column. You can read more about it in this article: https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-hidden-relevant-an...

Basically, on your conditional question, put an expression in the relevant column that evaluates to "true" or "false". Like selected(${question_1}, 'a').

- Josh Carlson
Kendall County GIS
cole_KTB
Occasional Contributor

Thanks Josh this definitely helps. 

I have an additional question to go along with this, using the ${q1}='x' conditional function in the body::visible, will this work properly with "select_multiple" questions? I would like to include this conditional Q if X is selected alone OR along with X, Y and Z etc. How would I write this expression? ${Q1} = 'X' or 'X + Y" + etc... I am not fimiliar with XLS form language. 

0 Kudos
cole_KTB
Occasional Contributor

I was able to solve this problem using the "selected()" function in the body::visible column! 

0 Kudos