ArcGIS OnLine - Detect Change (Geometry and Attribute) using Arcade Script
Channel: GIS Coordinated
Date: 2023-01-12

Video 158

In this video I demonstrate the use of $originalFeature.
This allows you to retrieve data (geometry/attribute values) from a feature that has been edited by the user.  This means you can compare the "old" or "original" geometry with the "new" geometry.

In the video I show you how far a point was moved and on what bearing in a web form in a Map Viewer.  The same Arcade Script can be used in an Instant App and in Field Maps for the mobile user. So it is portable.

The expression is linked to your attribute in the form and the Arcade itself is:

var changeinfo
var distancemoved
var bearingcalc

if (Equals(Geometry($feature), Geometry($originalfeature))) {
    //changeinfo = "Geometry was NOT updated!"
} else {
    //changeinfo = "Geometry was updated!"
    distancemoved = Ceil(Distance(Geometry($originalfeature), Geometry($feature)),2)
    bearingcalc = Ceil(Bearing(Geometry($originalfeature), Geometry($feature)),2)
    changeinfo = "Point was moved " + distancemoved + " metres on a bearing of " + bearingcalc + " degrees"
}
return changeinfo

The above should work on any point features. But you need a string field in your service to store "changeinfo".