HOW TO
In ArcGIS Pro, Arcade expressions with multiple statements can be used to split and reposition text strings of labels. The repositioned text strings can be used for data management and this article provides the workflow using Arcade expressions.
An ArcGIS Pro map with labels is shown below.
var <variableName1> = Split($feature.<featureName>, ' ')
var <variableName2> = Count(<variableName1>)
if (<variableName2> == 0) { return '' }
if (<variableName2> == 1) { return $feature.<featureName> }
if (<variableName2> == 2) { return <variableName1>[1] + ' ' + <variableName1>[0] }
if (<variableName2> == 3) { return <variableName1>[1] + ' ' + <variableName1>[2] + ' ' + <variableName1>[0] }
if (<variableName2> == 4) { return <variableName1>[1] + ' ' + <variableName1>[2] + ' ' + arrName[3] + ' ' + arrName[0] }
var arrName = Split($feature.Forest_Name, ' ') var lenName = Count(arrName) if (lenName == 0) { return '' } if (lenName == 1) { return $feature.Forest_Name } if (lenName == 2) { return arrName[1] + ' ' + arrName[0] } if (lenName == 3) { return arrName[1] + ' ' + arrName[2] + ' ' + arrName[0] } if (lenName == 4) { return arrName[1] + ' ' + arrName[2] + ' ' + arrName[3] + ' ' + arrName[0] }
The map with the newly configured labels after applying the Arcade expression is shown below.
Get help from ArcGIS experts
Download the Esri Support App