Skip To Content ArcGIS for Developers Sign In Dashboard

ArcGIS Arcade

Profiles

A profile is a context in which an Arcade expression is evaluated and understood. They expect specific inputs and output types depending on the use case. Arcade expressions may be executed in any of the following profiles:

See below for a more detailed explanation of the profiles and how they are used.

Alias

The alias profile allows the map author to write an expression to evaluate a numeric value and return a text alias representing that value.

When the alias is needed, the script will be evaluated. It will be passed the value for which an alias is desired. It is expected that the script returns a text value, comprising the alias to be shown.

Globals

Variable Name Type Description
$value Number The numeric value for which a text alias is desired.

Return types

Text

Attribute Rules

The following profiles are designed for Attribute Rules.

Evaluation of batch calculation and validation rules is available at ArcGIS Enterprise 10.7 or later.

Attribute Rule Calculation

Since version: 1.5

With the Attribute Rule Calculation profile, expressions can be written to update field values based on expression logic. This profile is used for calculation attribute rules tools in ArcGIS Pro. When the attribute rule is evaluated for a dataset, the return value for the expression is cast to the field type of the output value. It is best practice to handle casting within the script for full control of casting behavior to Number, Date, or Text return types.

Globals

Variable Name Type Description Since version
$datastore FeatureSetCollection A collection of layers in the same feature service or database as the $feature executing the script. 1.5
$editcontext.editType Text Indicates whether the edit event is INSERT, UPDATE, DELETE, or NA (not applicable). 1.10
$feature Feature The feature being calculated. 1.5
$originalFeature Feature The previous state of the feature being calculated. 1.9

Return types

Number | Text | Date | Dictionary

For a list of valid dictionary keywords, click here.

Examples of this profile in context

Attribute Rule Constraint

Since version: 1.5

With the Attribute Rule Constraint profile, expressions can be written to evaluate whether or not a feature meets the criteria defined in the expression. This profile is used for constraint attribute rules in ArcGIS Pro. The script should return a Boolean with true indicating the feature meets the constraint criteria or false indicating it does not meet the criteria. You can also return a custom error message by returning a Dictionary of errorMessage.

Globals

Variable Name Type Description Since version
$datastore FeatureSetCollection A collection of layers in the same feature service or database as the $feature executing the script. 1.5
$editcontext.editType Text Indicates whether the edit event is INSERT, UPDATE, DELETE, or NA (not applicable). 1.10
$feature Feature The feature being evaluated for the constraint. 1.5
$originalFeature Feature The previous state of the feature being evaluated. 1.9

Return types

Boolean | Dictionary

For a list of valid dictionary keywords, click here.

Examples of this profile in context

Attribute Rule Validation

Since version: 1.5

With the Attribute Rule Validation profile, expressions can be written to evaluate whether or not a feature meets the criteria defined in the expression. This profile is used for validation attribute rules in ArcGIS Pro. The script should return a Boolean with true indicating the feature meets the validation criteria or false indicating it does not meet the criteria.

Globals

Variable Name Type Description Since version
$datastore FeatureSetCollection A collection of layers in the same feature service or database as the $feature executing the script. 1.5
$editcontext.editType Text Indicates whether the edit event is INSERT, UPDATE, DELETE, or NA (not applicable). 1.10
$feature Feature The feature being evaluated for the constraint. 1.5
$originalFeature Feature The previous state of the feature being evaluated. 1.9

Return types

Boolean | Dictionary

For a list of valid dictionary keywords, click here.

Examples of this profile in context

Validation attribute rule examples in ArcGIS Pro

Constraint

Since version: 1.6

With the Constraint profile, expressions can be written to evaluate whether or not a feature meets the criteria defined in the expression. This profile is used for advanced attribute editing in the ArcGIS API for JavaScript. The script should return a Boolean with true indicating the feature meets the constraint criteria or false indicating it does not meet the criteria.

Globals

Variable Name Type Description
$feature Feature The feature being evaluated for the constraint.

Return types

Boolean

Examples of this profile in context

Dashboard

Since version: 1.11

The Dashboard profile is used for the list and indicator elements in the ArcGIS Dashboards Beta. An expression can be written to customize the way elements render data points. It is expected that the script returns a dictionary of name-value pairs specific for the element.

Globals

Variable Name Type Description
$datapoint Feature | Dictionary The data point being evaluated for the visual element. Applies to indicator and list elements.
$reference Dictionary The reference value being evaluated for the visual element. Applies to indicator elements.

Return types

Dictionary

For a list of valid dictionary keywords, click here.

Note: The dashboard profile does not support feature sets and geometry functions.

Dictionary Renderer

Since version: 1.11

The dictionary renderer profile allows the author of a dictionary renderer style to write an expression that evaluates to a text value used to construct a symbol. The string contains semi-colon separated style item keys as well as the primitive overrides used to override specific aspects of the symbol. See the Dictionary Renderer Toolkit for specifics on expected return values. When the feature is to be drawn, the script will be evaluated. The returned value will then be processed by looking up symbols by key from the dictionary and overriding them where specified.

Globals

Variable Name Type Description
$feature Feature The feature which is to be drawn on the map.
$config Dictionary A dictionary of configuration values.

Return types

Text

Examples of this profile in context

Field Calculate

Since version: 1.5

With the Field Calculate profile, expressions can be written to update a field value based on expression logic. This profile is used in field calculation tools in ArcGIS Pro, ArcGIS Enterprise, and ArcGIS Online. When the script is evaluated, the return value is cast to the field type of the output value. It is best practice to handle casting within the script for full control of casting behavior to Number, Date, or Text return types.

Globals

Variable Name Type Description
$feature Feature The feature being calculated.
$datastore FeatureSetCollection A collection of layers in the same feature service or database as the $feature executing the calculation.

Return types

Date | Number | Text

Field Mapping

Since version: 1.7

With the field mapping profile, expressions can be written to define a field map between source and target layers. The field map is used by the transfer attribute tool, copy/paste attributes and other editing tools where a field map can be specified.

Globals

Variable Name Type Description
$sourcefeature Feature The source feature for the field map.
$targetfeature Feature The target feature for the field map.
$sourcelayer FeatureSet A collection of features in the same layer as $sourcefeature.
$targetlayer FeatureSet A collection of features in the same layer as $targetfeature.
$map FeatureSetCollection A collection of layers in the map of the executing arcade expression.
$sourcedatastore FeatureSetCollection A collection of layers in the same datastore as the $sourcelayer.
$targetdatastore FeatureSetCollection A collection of layers in the same datastore as the $targetlayer.

Return types

Dictionary

GeoAnalytics

Since version: 1.7

The GeoAnalytics profile allows analysts to use expressions as input parameters to GeoAnalytics tools. These expression parameters are used in selected GeoAnalytics tools to calculate field values, detect incidents, buffer features, and more. This profile is only used in GeoAnalytics tools.

Globals

Variable Name Type Description
$feature Feature The feature being calculated.

Return Types

Number | Text | Date

Labeling

The labeling profile allows the map author to write an expression that determines the label to show on the map for each feature. The script evaluates for each label as it is to be drawn. It is expected that the script returns a text value, comprising the label to be drawn.

Globals

Variable Name Type Description
$feature Feature The feature whose label is to be drawn on the map.

Return types

Text

Examples of this profile in context

Layout

Since version: 1.11

The layout profile allows the map author to write an expression that evaluates to a value to be used in a layout dynamic text element. When the layout draws, the script will be evaluated. It is expected that the script returns a text value.

Globals

Variable Name Type Description
$feature Feature The feature whose values may be displayed in the layout.

Return types

Text

Examples of this profile in context

Measure Visualization

Since version: 1.7

The measure visualization profile allows the map author to write an expression that evaluates to a value used to drive the visualization of measure values along a line. This is used in the context of linear referencing hatching of m-aware lines. When each measure value is drawn, the measure value is interpolated for the marker location and passed into the script. It is expected that the script returns the desired value to draw via a text graphic in a marker symbol.

Globals

Variable Name Type Description
$measure Number The interpolated M-value for the marker location.
$feature Feature The feature which is to be drawn on the map.
$view.scale Number Returns the scale of the map at the time the expression evaluates.

Return types

Text | Number

Examples of this profile in context

Since version: 1.1

With the popup profile, map authors can write expressions that return values for display in the view's popup. Expressions can be referenced in the popup content's text template, field tables, and media charts. When the popup displays, the script will execute using the feature's attributes as variables in the expression. The script should return either text, a number, or date and place it in the table cell or text comprising the popup's content. Values returned for charts will be used as the basis for the data-driven chart.

Globals

Variable Name Type Description
$feature Feature The feature whose popup is to be displayed in the view.
$layer FeatureSet A collection of features in the same layer as the $feature whose popup is displayed in the view. Only supported for feature service layers.
$map FeatureSetCollection A collection of feature service layers in the same map as the $feature whose popup is displayed in the view.
$datastore FeatureSetCollection A collection of layers in the same feature service or database as the $feature whose popup is displayed in the view.

Return types

Text | Number

Examples of this profile in context

Feature Z

Since version: 1.5

With the Feature Z profile, expressions can be written to calculate z values for features in a 3D scene. This is useful for features that don't have z values included in their geometry, or for dynamically changing the z value of features either using the former z value, attribute values, or a combination of both. Expressions in this profile must return a Number.

Globals

Variable Name Type Description
$feature Feature The feature requiring a Z value.

Return types

Number

Examples of this profile in context

Visualization

The visualization profile allows the map author to write an expression that evaluates to a value used to drive the visualization. This could be used for a visual variable such as size, or as a value in a class breaks renderer. When the feature is to be drawn, the script will be evaluated. It is expected that the script returns a value specific to the rendering property being calculated (e.g. A number for a class breaks visualization or text for a unique value visualization).

Globals

Variable Name Type Description
$feature Feature The feature which is to be drawn on the map.
$view.scale Number Returns the scale of the map at the time the expression evaluates.

Return types

Text | Number

Examples of this profile in context


Feedback on this topic?