Hello,
I am hoping this is a fairly simple question but I'm just a bit unclear on the syntax for Arcade and haven't been able to find the answer I need.
I want to return a certain value based on whether the county name is in a predefined list or not.
Something like this:
var counties = ['County1', 'County2']
if ( $feature.NAME IN counties ) {
return "Processed"
}
else {
return "Not Processed"
}
Thanks in advance for any guidance!
Cheers,
KC
Solved! Go to Solution.
Not sure if this is the offical way of doing this but if you use indexOf(list, value) and the value isn't in the list it returns a -1, so you can set up a little switch using it! See below:
var counties = ['County1', 'County2']
IIF(indexOf(counties, $feature.NAME) != -1, "Processed", "Not Processed")
Not sure if this is the offical way of doing this but if you use indexOf(list, value) and the value isn't in the list it returns a -1, so you can set up a little switch using it! See below:
var counties = ['County1', 'County2']
IIF(indexOf(counties, $feature.NAME) != -1, "Processed", "Not Processed")
Thanks for the quick reply! That works!