Arcade label expression for displaying suite numbers

2040
8
Jump to solution
11-15-2017 01:28 PM
BPriyaK
New Contributor III

I'm working on arcade label expression to show suite numbers vs the civic number if its a condo complex. 

I could not figure out what's wrong with my expression, but the same logic expression works in arc map.

any insight will be appreciated.

The expression is :


    IIf(IsEmpty($feature.UNIT_NUM), $feature.CIVIC_NUM, $feature.UNIT_NUM)

VB Label expression in arcmap is :

Function FindLabel ( [CIVIC_NUM], [UNIT_NUM] )
if ( [UNIT_NUM] <> "<Null>" ) then
FindLabel = [UNIT_NUM]
else
FindLabel = [CIVIC_NUM]
end if
End Function

Would any be able to shed some light on how to achieve this.

Thanks in advance

0 Kudos
1 Solution

Accepted Solutions
KellyGerrow
Esri Frequent Contributor

Hi Bhanu,

Are you able to share the web map?

-Kelly

View solution in original post

0 Kudos
8 Replies
XanderBakker
Esri Esteemed Contributor

Just wondering, does the field UNIT_NUM contain a string "<Null>" or is it really empty? If it is empty you van use this and see what it does. The Console statements will print the values to the console and allows you to check if it is correct:

var CivicNum = $feature.CIVIC_NUM;
var UnitNum = $feature.UNIT_NUM;
Console("CIVIC_NUM:" + CivicNum);
Console("UNIT_NUM :" + UnitNum);

var label = "Err";
if (UnitNum != null) {
    label = UnitNum;
} else {
    label = CivicNum;
}
return label;
BPriyaK
New Contributor III

Hello!1

I tried the expression but still no luck!!

It labels only the unit numbers but not he civic's when unit numbers are null.

Also, The unit number field has empty values and not string <Null>.

Tried the expression condition to <No value> as that's what the detailed view shows on ArcGIS Online item details.

0 Kudos
KellyGerrow
Esri Frequent Contributor

Hi Bhanu,

Are you able to share the web map?

-Kelly

0 Kudos
BPriyaK
New Contributor III

Hello Kelly,

here is a link to the web map 

https://airdrie.maps.arcgis.com/home/item.html?id=0357842fa6ba41e490a3ed40a3c5ebb8 

I have an expression as mentioned above in the map as Address Label.

Thanks for taking time to look into this

appreciate it !!

Bhanu

0 Kudos
KellyGerrow
Esri Frequent Contributor

Hi Bhanu,

The blank value of your unit numbers is a space and not a null value. If you change null to " " the labels will appear.

var CivicNum = $feature.CIVIC_NUM;
var UnitNum = $feature.UNIT_NUM;
Console("CIVIC_NUM:" + CivicNum);
Console("UNIT_NUM :" + UnitNum);

var label = "Err";
if (UnitNum != " ") {
    label = UnitNum;
} else {
    label = CivicNum;
}
return label;

https://arcg.is/0WGn9u 

-Kelly

BPriyaK
New Contributor III

That is fantastic !!

Thank you so much for your insight and helping me figure what the error was .

Thanks again !!

0 Kudos
BPriyaK
New Contributor III

That explains why I couldn't filter values that are blank ,as it had the space all along .

0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi Bhanu Vedula , glad that KGerrow-esristaff could resolve your problem. Can you mark her answer as the correct one?

Thanks!

0 Kudos