Select to view content in your preferred language

How to construct a "not in list"-type expression

484
3
04-06-2023 03:31 PM
BrianHall7
New Contributor III

I'm trying to construct an expression for the body::esri:visible column to hide a question group if the response to a previous question is one of several possible values. First the user selects a Facility Profile from a select_one question. Then if that selected Facility Profile is 5, 6, 7, or 8, then hide a question group. (These values are actually text strings in my survey)

I can get ${FacilityProfile}!='5' to work, but how can I make an expression along the lines of ${FacilityProfile} not in ('5'.'6','7','8') to work?

0 Kudos
3 Replies
BarbaraWebster1
Esri Regular Contributor

Hi @BrianHall7,

You could write each body::esri:visible expression separated by an 'and' operator. For example:

${FacilityProfile}!='5' and ${FacilityProfile}!='6' and ${FacilityProfile}!='7' and ${FacilityProfile}!='8'


- Barbara

BrianHall7
New Contributor III

Yes, I suppose I could use 'or' between the expression elements. I'm facing some pretty huge expressions, so I was hoping to shorted them a bit.

0 Kudos
DanielRaleigh
New Contributor II

Have you investigated Cascading Select?

I haven't used the body::esri:visible column option, but I use Cascading Select for one of my projects. Within that form, the workflow proceeds in this fashion:

If I choose Option A, I want to see SubOptions 1, 2, 3

If I choose Option B, I want to see SubOptions 4, 5, 6, 7

If I choose Option C, I want to see SubOptions 8, 9    (etc.)

...further down the form, I prompt specific questions to appear or disappear based on the initial "Option" choice, and can even specify if I want a question to appear if OptionA/2 was selected, but not if OptionA/3 was chosen, for instance.

If that might be helpful to you, please let me know and we can try to connect on this topic.

0 Kudos