Since version: 1.5
With the Field Calculation 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.
Context
The following products implement this profile:
- ArcGIS Pro
- ArcGIS Enterprise
- ArcGIS Online
- ArcGIS Maps SDKs for Native Apps
Spatial reference
The spatial reference of the expression's data source1 determines the execution context's spatial reference.
Time zone
The time zone of the expression's data source1 determines the execution context's default time zone.
Profile variables
Variable Name | Type | Description | Since version |
---|---|---|---|
$feature | Feature | The feature being calculated. | 1.5 |
$datastore | FeatureSetCollection | A collection of layers in the same feature service or database as the $feature executing the calculation. | 1.5 |
Function bundles
Core | Geometry | Data Access | Portal Access | Knowledge Graph
Return types
Number | Text | Date | DateOnly | Time
Example
The following example concatenates text values from existing fields to create a new text field.
Concatenate($feature.room, $feature.floor)
- Data source can be a feature service, file geodatabase, mobile geodatabase, or mobile service.