We have a description field in our address feature class and one of the values is 'BUSINESS'. We have two other fields, Unit Number and Building Number. In working to migrate labeling language from VB Script to Arcade, we would like to label on the following conditions:
Applies to all where the description is BUSINESS
- If the building number is not null, label the building number and not the situs number.
- if the unit number is not null, label the unit number and not the situs number.
- If the building and unit numbers are both NULL, label the situs number
- Not often, but if both unit number and building number are both not null, label both unit number and building number, do not label situs number
Below is the code that I currently am working with. The portion that pertains to my question is where the description is 'BUSINESS'.
var d = $feature.Description
var s = $feature.SitusNum
var u = $feature.UnitNum
var b = $feature.BuildingNum
if(d == 'SINGLE'){
return s
} else if(d == 'TOWNHOME'){
return s
} else if(d == 'ACCESSORY DWELLING'){
if(IsEmpty(u)){
return s}
else{
return s + ' - ' + u}
} else if(d == 'DUPLEX'){
if(IsEmpty(u)){
return s}
else{
return s + ' - ' + u}
} else if(d == 'MANUFACTURED'){
if(IsEmpty(u)){
return s}
else{
return s + ' - ' + u}
} else if(d == 'CONDO'){
if(IsEmpty(u)){
return s}
else{
return u}
} else if(d == 'MULTIFAMILY'){
if(IsEmpty(u)){
return s}
else{
return u}
} else if(d == 'BUSINESS'){
if(IsEmpty(b)){
return s}
else{
return b}
} else if(d == 'BUSINESS'){
if(IsEmpty(u)){
return s}
else{
return u}
} else if(d == 'CARE FACILITY'){
if(IsEmpty(u)){
return s}
else{
return u}
} else if(d == 'PRIVATE PARK'){
return s
} else if(d == 'PUBLIC FACILITY'){
if(IsEmpty(u)){
return s}
else{
return u}
} else if(d == 'GARAGE'){
if(IsEmpty(u)){
return s}
else{
return u}
} else if(d == 'PARKING GARAGE'){
return s
} else if(d == 'STORAGE UNIT'){
if(IsEmpty(u)){
return s}
else{
return u}
}
Brian