
Var FtName = $feature["NAME"]
var FtSplit = Split(FtName, ' ', -1)
Var Counter = Count(FtSplit)
var FirstLine = FtSplit[0] + ' ' + FtSplit[1]
Var SecondLine = Replace(FtName, FirstLine, '')
Var SecondLine2 = FtSplit[2] + ' ' + FtSplit[3]
Var ThirdLine = Replace(SecondLine, SecondLine2, '')
If (Counter > 3){
If(Counter > 4){
Var output2 = FirstLine + TextFormatting.NewLine + SecondLine2 + TextFormatting.NewLine + ThirdLine
Return output2
}else{
Var output1 = FirstLine + TextFormatting.NewLine + SecondLine
Return output1
}
}else{
Return $feature["NAME"]
}Hi All,
I probably have something wrong with my Arcade expression I just can't figure out what.
When I use this code, all labels with less than 3 words disappear and will not show. I am trying to create an expression that can handle varied number of word labels and create a stacked view for the labels so when they are published to Portal and viewed in Map Viewer they look a little nicer.
If anyone has any suggestions or sees the problem, help would be appreciated!