HOW TO
In ArcGIS Pro, when labeling a feature layer, it is sometimes necessary to truncate a field value with multiple words and only display the first word to avoid cluttering the map. However, in some instances, the first word of the field values is short and cannot be shortened further.
In this article, an Arcade expression is used to truncate fields with multiple words, leaving the first word of the field based on a condition. If the condition is not met, the second word is also displayed in the label on the map.
In this example, the field value in the Company field is truncated when the first word consists of more than three characters. If the first word consists of three characters or less, the second word is also displayed in the label on the map.
Note: In the Contents pane, ensure the selected feature layer and feature class check boxes are checked to display the labels.
var name_parts = Split($feature.<field_name>, ' ')
IIF(Count(name_parts[0]) > <value>, name_parts[0], `${name_parts[0]}\n${name_parts[1]}`)
The image below displays the truncated labels of field values with multiple words on a map in ArcGIS Pro.
Get help from ArcGIS experts
Download the Esri Support App