I am just starting to play around with Arcade Expressions and am having some issues using an expression to symbolize a multipatch layer.
The layer is building floor numbers (e.g., 1,2,3,4,5,6….) and is a numeric field in Pro.
I am using this expression and it works for only 1 floor:
if ($feature.FLR_NUM == 20) return true
However, I can’t figure it out the correct expression for multiple floors (e.g., I want only floor numbers 10, 13, 20, and 23 to be a color). I am getting error messages (close parenthesis expected). Or “requested operation could not be completed” even though the expression is valid.
Any help would be greatly appreciated.
Thanks
Solved! Go to Solution.
Hi Brian E ,
You could use something like this:
var floors = [10, 13, 20, 23];
if (IndexOf(floors, $feature.FLR_NUM) > -1) {
return "Floor 10, 13, 20 or 23";
} else {
return "Other floors";
}
We start with an array with the floors you are looking for (on line 1). Then we use the IndexOf function to see if the features floor is part of that list and return a text to symbolize on.
Hi Brian E ,
You could use something like this:
var floors = [10, 13, 20, 23];
if (IndexOf(floors, $feature.FLR_NUM) > -1) {
return "Floor 10, 13, 20 or 23";
} else {
return "Other floors";
}
We start with an array with the floors you are looking for (on line 1). Then we use the IndexOf function to see if the features floor is part of that list and return a text to symbolize on.
Xander,
That worked. Thanks so much!