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
Solved! Go to Solution.
Ah yes, apologies I read through too quickly. Are you able to screenshot to include the relevant column and contents and copy past the exact cell content/expression into the thread?
It really seems like missing parentheses, syntax or spelling error - e.g. I can also see farm_type instead of Farm_type in the expression you shared previously (but am unsure if it is case sensitive).
It's all done using the 'relevant' column in Connect.
Here's a good example of showing an 'issue comments' question with visibility dependent on either of 2 questions.
If your questions have multiple answers e.g. arable and pasture - then use the 'selected()' syntax
https://community.esri.com/t5/arcgis-survey123-questions/quot-relevant-quot-field-syntax-for-multipl...
You can use their the relevant or the body::esri:visible column. They have the same visual effect, but their back-end process is different.
Relevant will hide something, and in doing so make it null. Aka, if it's hidden, it doesn't exist.
body::esri:visible will just hide something (end of storey). Aka, if it's hidden, it still exists.
In either case, I highly recommend you use selected(${my_question},'Hello World'). Yes, you can use ${my_question}='Hello World', but that doesn't always work (e.g., for select_multiple), whereas the selected() approach is much more reliable.
Here is an example:
Hi. Thanks for your response. So I am aware of using the selected expression and have used this in other questions on my form, but, want I am trying to do is to reference multiple questions in the selected expression e.g if 'arable' is selected in Farm_type, or or if 'arable' is selected in Main_farm_enterprise or if 'arable' is selected in Other_enterprises then show the question'what crops are grown?' (see screenshot below) Is that possible? I have tried various expressions like the following but always get errors
selected(${farm_type}, 'Arable') or selected(${Main_farm-enterprise}, 'Arable') or selected(${Other_enterprises}, 'Arable')
selected(${Farm_type}, 'Arable'or ${Main_farm_enterprise}, 'Arable' or ${Other_enterprises}, 'Arable')
Thanks
The error seems to reference crops_grown which doesn't seem to be related to this question. I'd look for that expression and fix or remove it from xls.
The first xepression should work, aside from a dash instead of underscore typo in main_farm_enterprise.
selected(${farm_type}, 'Arable') or selected(${Main_farm_enterprise}, 'Arable') or selected(${Other_enterprises}, 'Arable')
Crops grown is the question I am writing the expression for - I only want this question to display if they select arable to any of the other 3 questions.
Ah yes, apologies I read through too quickly. Are you able to screenshot to include the relevant column and contents and copy past the exact cell content/expression into the thread?
It really seems like missing parentheses, syntax or spelling error - e.g. I can also see farm_type instead of Farm_type in the expression you shared previously (but am unsure if it is case sensitive).
Something about the expression is wrong, I just don't know what. I've changed case to match the name field and tried writing the expression in different ways but nothing is working.
You are putting the expression in the column called 'relevant' right?
I've got it working, like you said I was missing parentheses. Correct expression below.
(selected(${Farm_type},'Arable') or selected(${Main_farm_enterprise},'Arable') or selected(${Other_enterprises},'Arable'))
This post helped: Relevant Expression - multiple parameters - Esri Community
Thanks for your help David, it's much appreciated