Select to view content in your preferred language

Arcade Expressions for Symbology

2160
2
Jump to solution
06-30-2020 06:05 AM
BrianE
by
Frequent Contributor

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

0 Kudos
1 Solution

Accepted Solutions
XanderBakker
Esri Esteemed Contributor

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. 

View solution in original post

2 Replies
XanderBakker
Esri Esteemed Contributor

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. 

BrianE
by
Frequent Contributor

Xander,

That worked. Thanks so much!