Skip to content
import { getExpressionsFromLayer } from "@arcgis/core/layers/support/arcadeUtils.js";
Since
ArcGIS Maps SDK for JavaScript 4.25

Contains convenience methods for getting Arcade expressions defined on a layer.

Functions

getExpressionsFromLayer

Function

Returns all Arcade expressions defined on a given layer and provides metadata describing the context for which each expression was authored.

Known Limitations

Expressions set in the following places will not be returned from this method.

Signature
getExpressionsFromLayer (layer: LayerWithExpression): ExpressionInfo[]
Parameters
ParameterTypeDescriptionRequired
layer

The layer from which to get all Arcade expressions.

Returns
ExpressionInfo[]

Resolves to an array of objects containing all the Arcade expressions defined on the input layer along with metadata describing the context in which each expression was defined.

Type definitions

ExpressionInfo

Type definition

Represents the result of the getExpressionsFromLayer() method. Contains an Arcade expression, along with metadata about the context in which the expression was defined.

expression

Property
Type
string

An Arcade expression defined on a layer.

name

Property
Type
string | null | undefined

The name of the expression used when referencing it in popup and form templates.

title

Property
Type
string | null | undefined

The expression's title, describing it in the legend and other UI elements.

profileInfo

Property
Type
ProfileInfo

Information about the profile, or environment, where the expression was defined.

ProfileInfo

Type definition

name

Property
Type
ProfileName

Indicates which profile is used to execute the expression.

context

Property
Type
ProfileContext

Describes the context (i.e. the API class) where the expression was defined.

source

Property
Type
"layer" | "feature-reduction" | undefined

Indicates the data source used to hydrate the expression's profile variables.

returnType

Property
Type
ProfileReturnType | undefined

The return type of the expression. This is typically set in popup expressions for formatting purposes.

ProfileReturnType

Type definition
Type
"boolean" | "date" | "number" | "string" | "dictionary"

ProfileContext

Type definition

Describes the context for which an Arcade expression was defined.

Type
VisualizationProfileContext | PopupProfileContext | FeatureZProfileContext | "label-class" | "form-template" | "aggregate-field"

VisualizationProfileContext

Type definition

Describes the context for which an Arcade expression was defined using the visualization profile.

Type
"unique-value-renderer" | "class-breaks-renderer" | "dot-density-renderer" | "heatmap-renderer" | "pie-chart-renderer" | "color-variable" | "size-variable" | "opacity-variable" | "rotation-variable"

PopupProfileContext

Type definition

Describes the context for which an Arcade expression was defined using the popup or popup element profile.

Type
"popup-template" | "popup-expression-content"

FeatureZProfileContext

Type definition

Describes the context for which an Arcade expression was defined using the Feature Z profile.

Type
"order-by" | "elevation-info"