// This rule will populate the edited features field with a value from an intersecting feature
// Value to copy from the intersected feature
var intersecting_field = "GRTS_ID";
//Field rule is assigned to in the Attribute Rule
var feature_field = "GRTS_ID";
// Create feature set to the intersecting class using the GDB Name
var intersecting_featset = FeatureSetByName($datastore, 'NABAT_CONUS_10x10_KM_GRID_CELLS_PRJ', [intersecting_field], true);
// Intersect the edited feature with the feature set and retrieve the first feature
var intersected_feature = First(Intersects(intersecting_featset, $feature));
// Check to make sure there was an intersected feature, if not, return the original value
if (intersected_feature == null)
// If the intersected feature is null, return the original value
// Return the intersected features value
Where NABAT_CONUS_10x10_KM_GRID_CELLS_PRJ is a polygon feature class with the field GRTS_ID (Type Long) and the field I'm wanting to edit in the source feature class is also GRTS_ID (Type Long).
What is happening though is on insert and update, the GRTS_ID field in the feature class being edit instead gets the ObjectID of the intersecting Polygon. 100% sure I've gotten something wrong here.