I am trying to clean up the labeling for a city zoning map using ArcGIS Online. To do this I need to trim the property address to only the numeric values, which has been accomplished, but due to incomplete data some values in the Property_Address field do not have street address number so the the expression will display the first four characters of the name of the street address. I need this second expression to be able to determine if numerical or text characters will be output and if there are no numerical characters and text is present, then those characters need to be hidden.


IIF(Left($feature.PropertyAd,4) != 

1 Answer 1


First check for a space in the address usually the numbers are first, then check if the fist split is number or string them do stuff accordingly I wrote something short and tested in ESRI playground.

var str = '1234 N. Street Name'
var index=Find(' ', str , 0)
var nfirstSplit = Number(Split(str,' ')[0])
var tfirstSplit = Text(nfirstSplit)
IIf(index>0, IIf(tfirstSplit=='NaN','',nfirstSplit),'if no space check if string is number and do stuff')

In VB Script

Function FindLabel ( [ADDRESS] )
  newstrings = Split([ADDRESS]," ")
  For Each newstring In newstrings
    If IsNumeric(newstring) Then
      anotherstring = ""
      anotherstring = anotherstring +" "+ newstring + " "
    End If
  FindLabel = anotherstring

End Function

Make Sure You Are Using Advance Setting In Label]1


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.