Summary
In ArcGIS Pro, it is possible to automatically return null values for XY coordinates in an attribute table after moving point features to a different location on the map. This functionality can be implemented using attribute rules that trigger when the feature geometries are changed. Automating this process ensures the outdated XY coordinates are deleted, providing flexibility to identify and update only the modified features by recalculating the XY coordinates using the Calculate Geometry Attributes tool.
This article provides the workflow to automatically return XY coordinates as null values in the attribute table after point features are moved in ArcGIS Pro.
Procedure
Note:
An ArcGIS Pro Standard license or higher is required to create and manage attribute rules.
- Open the ArcGIS Pro project.
Note:
The feature layer requires Global IDs to add an attribute rule.
- Add the Global ID field to the attribute table of the point feature layer using the Add Global IDs tool. Refer to ArcGIS Pro: Add Global IDs (Data Management) for more information.
- In the Contents pane, right-click the point feature layer and click Data Design > Attribute Rules. The Attribute Rules view opens.
- Add attribute rules to the X and Y coordinate fields in the Attribute Rules view. In this example, the PointX field stores the X coordinates, and the PointY field stores the Y coordinates.
- In the Attribute Rules view, on the Calculation tab, click the Add Rule drop-down list and select Immediate Calculation.
- In the New Rule pane, specify a name for Rule Name. In this example, 'Calculate PointX' is used.
- For Description, specify a description of the new rule.
- For Field, click the drop-down list and select the X coordinate field. In this example, PointX is selected.
- In the Expression box, specify the following Arcade expression and replace <X_field> with the X coordinate field.
var shape = Geometry($feature.<X_field>);
if (isEmpty(shape)){
return null;
}
- Under Triggers, check the Update check box.
- Repeat Steps 4(a) through 4(f) to add a new rule for the Y coordinate field in the Attribute Rule view using the following Arcade expression in the Expression box and replace <Y_field> with the Y coordinate field.
var shape = Geometry($feature.<Y_field>);
if (isEmpty(shape)){
return null;
}
- On the Attribute Rules tab, in the Manage Edits group, click Save.
The following image shows the X and Y coordinate fields automatically return as null values after the point features are moved on the map.