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.
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.
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.
// $feature is a profile variable representing the attributes // and geometry of a feature used as input for a popup or a renderer $feature.POPULATION / AreaGeodetic($feature, "square-miles")
// $map is a profile variable representing the layers in the feature's map var publicLandFeatures = FeatureSetByName($map, "public lands", ["class"], true);
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.
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.
// Will display as a text value: 2022-08-22T14:21:53.460-07:00 Now()
It is always best to explicitly return the proper data type.
// Will display as a text value: 09-09-2022 Text(Now(), "MM-DD-YYYY");