The display expression uses the most informative and unique field of an attribute table or table. For example, the display expression for a countries layer would use its name field, or the parcel number would be used for a parcels layer.
The display expression defaults to the first field of string type that contains the text name (case insensitive) in the field name. If no name field exists, the display field defaults to the first field of string type, then the first field of integer type, then the first field of any type. You can change the field used in the display expression on the Display tab of the Layer Properties or Table Properties dialog box.
The display expression is used throughout ArcGIS when working with that layer or table:
- Provides text for MapTips, which is the text displayed when you pause the pointer over a feature (You can enable MapTips on the Display tab.)
- Represents the feature in the Identify window when you use the Identify tool
- Represents the feature in the Attributes window when you are editing the attributes of selected features
- If you are working with a nonspatial table, represents the record in the Identify window when you identify a record from a table
- If you publish your map as a map service, is included in the map service for each layer in your map so that client applications that access the map service can display features and records with the display expression
Customizing the text string of the display field
You can customize the text string of the display expression by writing an expression. A display expression is a statement that specifies the text to be used on the Identify or Attributes window. Some examples of how you might use a display expression include entering your own text or combining the contents of multiple fields.
A display expression is similar to a label expression, which typically concatenates or modifies the contents of one or more fields, and may include additional text strings to create more informational display text. It can contain Visual Basic script or JScript to add logic and text processing. You can save and load display and label expressions interchangeably, although some functionality from label expressions may be ignored in display expressions. For example, text formatting tags cannot be used in display expressions.
Click the Expression button and build your expression on the dialog box that appears.