Since version: 1.28
With the Model Builder profile, expressions can be written to update a field value based on expression logic. This profile is used in model builder tools in ArcGIS Pro. 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:
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 |
---|---|---|
$variables | Dictionary | A dictionary containing variable names and values. |
Function bundles
Core | Geometry | Data Access | Portal Access
Return types
Array | Boolean | Dictionary | Number | Text | Date | DateOnly | Time | Geometry
Example
For a model with a variable named score, calculate if the score passed or failed and return the text.
if ($variables.score > 75){
return "Passed";
}
else {
return "Failed";
}
- Data source can be a feature service, file geodatabase, mobile geodatabase, or mobile service.