calculate_field
Write computed values to an attribute field in an ArcGIS Pro layer using Python, Arcade, or SQL expressions, so you can update areas, ratios, or other derived attributes.
Instructions
Calculate field values across a layer, e.g. expression "!Shape_Area! / 10000".
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"layer_name": "<layer_name>",
"field_name": "<field_name>",
"expression": "<expression>"
},
"name": "calculate_field"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| map_name | No | Map to act on; defaults to the active map. | |
| code_block | No | Optional helper function definitions. | |
| expression | Yes | Expression. | |
| field_name | Yes | Field to write to. | |
| layer_name | Yes | Layer or table name as shown by get_layers, or a full dataset path. | |
| expression_type | No | PYTHON3, ARCADE or SQL. | PYTHON3 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |