How To: Display labels from two or more fields in ArcGIS Pro
In ArcGIS Pro, when labeling is enabled, features are labeled based on the values of a selected field. The following image is a map showing each Arkansas county library in and around the Glenwood area labelled with the city name.
It is sometimes necessary to label a feature based on the values of two or more fields. This can be achieved using label expressions. For instance, a facility manager requiring the contact information of each county library in and around Glenwood. Displaying each library's city name and contact number in the labels quickly reveal the information the manager requires.
Follow the steps below to create and display labels based on the values of two or more fields in ArcGIS Pro.
- In ArcGIS Pro, open the project containing the layer.
- In the Contents pane, right-click the layer name, and select Label to turn on labeling.
- Right-click the layer name, and select Labeling Properties….
- In the Label Class pane, click the Language drop-down list, and select VBScript.
- Build the label expression, and run the script. In this example, the City and Contact fields are used to label the feature.
- Clear the Expression box before proceeding with the following steps.
- Under Fields, double-click City to add the City field to the Expression box.
- Key in '& vbnewline &' after the City field name in the Expression box to add a line break between the field values in the label. Alternatively, key in ‘& " " &’ to add a space instead of a line break between the field values.
- Under Fields, double-click Contact to append the Contact field to the expression.
- Click the Verify button to validate the expression.
- Click Apply to run the script.
Note: To add fields to the expression, add a space or a line break after each field name, and double-click the field name under Fields to append the field.
The image below shows each Arkansas county library in and around Glenwood labeled based on the values from the City and Contact fields.
- ArcGIS Pro: Specify text for labels
- ArcGIS Pro: Use label classes
- How To: Split labels from multiple fields to multiple lines in ArcMap
Last Published: 5/27/2021
Article ID: 000025040
Software: ArcGIS Pro 2.7.3, 2.7.2, 2.7.1, 2.7, 2.6.5, 2.6.4, 2.6.3, 2.6.2, 2.6.1, 2.6, 2.4.3, 2.4.2, 2.4.1, 2.4, 2.3.3, 2.3.2, 2.3.1, 2.3, 2.2.4, 2.2.3, 2.2.2, 2.2.1, 2.2, 2.1.3, 2.1.2, 2.1.1, 2.1, 2.0.1, 2.0