To Use Expressions to Label Features

You can create text or numeric expressions that determine the content of labels when you style features.

  1. Display the Style Editor for the feature or layer you are labeling.
  2. Under Feature Label, click for the appropriate entry.

    If you are theming this feature, there is one entry for each theme rule. Click the entry for a rule that displays labels.

    If your layer supports multiple geometry types (for example,point, line, and polygon), scroll down and click the Style cell for the appropriate geometry type.

  3. In the Style Label dialog box, click Add Label.
  4. To create an expression for the label content, click Text Content and scroll to the bottom of the list. Click Use Expression.
  5. In the Create/Modify Expressions dialog box, enter the expression.

    If you are using standard styles, use '\n' to insert a line break. If you are using enhanced styles, use '\P' instead. These parameters are case-sensitive.

    The following example shows a two-line label for enhanced styles. It displays the street name on the first line and the area of the parcel on the second line, and the APN code on the third line.

    Concat ( STNAME , '\P Area: ', AREA)

    Note:

    The label uses the Concat operator, which combines multiple properties and text strings and can include spaces and line breaks. For more information, see Text Functions.

    The static text (in this case, the words “Area:” and “APN:”) are surrounded by single quotes. Including a space after the text strings inserts a space between this static text and the dynamic property that follows it.

    The \P entry moves the subsequent text to a new line.

    For help with any expression element, see Creating Expressions - Reference.

  6. Click Apply and then Close to apply the expression to the labels.