I'm not familiar with Arcade, but I'm trying to do a simple expression. I need to write an if-else label expression that will label addresses by their address number, unless there is a address unit number; then I would want the label to show the unit number. I've researched this documentation https://developers.arcgis.com/arcade/function-reference/logical_functions/ . I need a statement something like: If address is not Null than populate, or else populate unit number. I'm just not familiar with the Arcade structure.
Solved! Go to Solution.
Sorry, this is my first time using Geonet and I added a new comment rather than replying. I'm not to sure if you will receive a notification from my comment so i'm replying here.
I need the address numbers to display/label by default, unless there is an address for the unit. There can be many units associated to the one address and we need to display these. For example, a parcel with 10 units should display the 10 unit numbers as separate points, but there is still an individual point with just the address number that should be displayed as well.
Try combining the "isEmpty()" and the "iif()" logic functions, which works similar to the if-function in Excel:
IIf( condition, trueValue, falseValue )
in your case, it sounds like it would be
Here's the Arcade Function Reference list for your reference:
I've made sure that the field is empty. Once I type in any number to ADDRUNIT that number will be labeled, but once I delete that unit number then the ADDRRNMBR is displayed. Otherwise, there is no label displayed.