Arcade Expression for Value isin (List of Values)

1953
1
Jump to solution
03-08-2022 08:04 AM
TylerTownes
New Contributor III

Hello,

I'm looking for assistance with an arcade expression for labels.  I need to check if a value is in a list of values.

Psuedo Code:

values = ['val1', val2, etc]
if value isin values:
return 1
else
return 0

Thank you,

Tyler

0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Esteemed Contributor

What you want is the Includes function.

var values = [
    'val1',
    'val2',
    'etc'
]

if (Includes(values, 'val1')){
    return 'it\'s in!'
} else {
    return 'not here'
}
- Josh Carlson
Kendall County GIS

View solution in original post

1 Reply
jcarlson
MVP Esteemed Contributor

What you want is the Includes function.

var values = [
    'val1',
    'val2',
    'etc'
]

if (Includes(values, 'val1')){
    return 'it\'s in!'
} else {
    return 'not here'
}
- Josh Carlson
Kendall County GIS