Select to view content in your preferred language

Conditional Visibility - show question if a particular choice is selected in one or more other questions

385
12
Jump to solution
01-06-2025 08:31 AM
LouiseHarris1
Regular Contributor

Hello

I have created a form and I need to set up conditional visibility that will show a question if 'arable' is selected in one or more previous questions.

Question - Farm Type

Question - Main Enterprise

Question - Other Enterprises

If 'Arable' is chosen for any of the above questions I want to show the question 'Crops Gown?' 

What expression do I need to use please?

Thanks

0 Kudos
12 Replies
Nicole_Ueberschär
Esri Regular Contributor

The overall syntax seems to be right, I would suspect spelling mistakes that make it fail to work as you expect it. Make sure to use the name, not the label, for the selection and double check the spelling of the question names especially upper/lower case. Do you still get an error or is it just now showing/hiding as expected?

0 Kudos
JenniferAcunto
Esri Regular Contributor

The second syntax is not correct. Selected() takes 2 parameters - the question name and the choice you are looking for. You cannot add anything extra. You need to combine 3 selected() functions:

 

selected(${Farm_type}, 'Arable') or selected(${Main_farm_enterprise}, 'Arable') or selected(${Other_enterprises}, 'Arable')

 

The next thing to check is to ensure that you are using the name of the choices and not the Label value. Also, what column do you have your statement in, it should be in the Relevant or body::esri:visible column.

 

- Jen
LouiseHarris1
Regular Contributor

I managed to get it working,  I was missing parentheses. Correct expression below.

(selected(${Farm_type},'Arable') or selected(${Main_farm_enterprise},'Arable') or selected(${Other_enterprises},'Arable'))

 

Thanks for all the quick responses and suggestions. Between them all I got it sorted.

0 Kudos