expression

The expression script used to calculate the label text. The expression may be a combination of literal text and attribute values from the feature being labeled. The syntax of the expression is determined by which label expression object is used: ArcadeLabelExpression, SimpleLabelExpression or WebmapLabelExpression.

A label expression using one scripting language can be replaced by an expression using a different scripting language just by creating an object of the new LabelExpression subclass and assigning it to LabelDefinition.expression.

The default value is an empty ArcadeLabelExpression, which will evaluate to an empty text label.

The expression needs to create a text string which will be used as the label text. The text string can be any legal UTF16 characters.

The text string can also include HTML-style formatting tags e.g.

"Hello World"

where the angle-bracketed tags will not appear in the label, but may change the presentation of the text. In the example, the "World" will appear in bold.

The available tags are:

  • "" for bold text

  • "" for underlined text

  • "" for italic text

  • "" for colored text

  • "" for text using a different size or font (if available on client).

Tags can be upper or lower case, but not a mixture. Tags can be nested e.g. "Hello World".

Full documentation of the tag parameters is available at https://pro.arcgis.com/en/pro-app/latest/help/mapping/text/text-formatting-tags.htm.

Note that not all ArcGISPro tags are currently supported in this API. The "" tag is currently only supported for text in 2D views. Any unsupported tags will be ignored and not written as part of the label text. Warning: If the expression attempts to use attributes which don't exist then no label will be produced. This is distinct from the attribute existing but having a null or empty value, which can form part of the produced text label.

Since

200.1.0