Profiles
A profile is the context in which an Arcade expression is evaluated and interpreted. An Arcade profile specifies:
- the execution context - or where you can use Arcade,
- the profile variables that can be used as input data values to the expression,
- the function bundles you may use, and
- the valid data types that may be returned from an expression.
Another way to think of a profile is the environment that controls Arcade’s execution. Arcade expressions will have different rules and specifications depending on the context in which they are executed.
See the Profile specifications to read about the profiles supported in ArcGIS products.
Execution context
The execution context of a profile indicates where you write the expression. For example, in the ArcGIS Online Map Viewer, you can author an expression that returns a label for your features in the labeling panel. This is the context where the Map Viewer implements the labeling profile.
Profile variables
A profile variable represents the input values to an expression. It is always preceded with a $
character. The profile variables available to an expression will vary depending on its context. See the Profile variables documentation for more information.
Function bundles
Not all Arcade functions are suitable for every profile. For example, profiles that execute expressions for all features in a layer (e.g. visualization and labeling) don't allow expressions to access data via FeatureSet functions.
Each profile's specification defines which function bundles are included in the profile.
Data types
The profile defines the valid data types that may be returned from an expression. If the expression returns an invalid type, the profile will attempt to implicitly cast the value to a valid type.
For example, the popup profile allows you to return a Text or a Number. If you author an expression that returns a Date, then the profile will cast the date to a text value.
It is always best to explicitly return the proper data type.