I have an ArcGIS geodatabase with a parent feature class related to a child stand alone table containing the various inspections made on each parent feature. Primary key is GlobalID and foreign key is GUID.
In ArcGIS Pro, I'm trying to edit an attribute rule to automatically populate a LAST_DATE_INSPECTION field in the parent feature class with the most recent inspection (DATE_INSPECTION field in the child table).
The code I did is only updating the parent LAST_DATE_INSPECTION field with the first inserted inspection date of the child table, not the most recent date. Looks like my filter isn't working.

// calculation attribute rule on child table, field DATE_INSPECTION
// triggers: Insert, Update, Delete
//Foreign key in child table
var fk = $feature.GUID
//Load all inspections of the feature
var related_inspection = FeatureSetByName($datastore, "CHILD_TABLE_NAME",['GUID'],false)
//Filter the most recent inspection date of the feature
var last_inspection = First(Filter(related_inspection, 'GUID = <a href="https://community.esri.com/t5/user/viewprofilepage/user-id/225383">@fk</a>'))
//Return nothing if no date found
if(IsEmpty(last_inspection)){
return ;
}
//Updating DATE_INSPECTION field in parent feature class
return {
"result": fk,
"edit": [{
"className" : "PARENT_FC_NAME",
"updates": [{
//selecting the parent feature to update
"GlobalID" : last_inspection.GUID,
//Update the LAST_DATE_INSPECTION field in parent feature class
"attributes" : {'LAST_DATE_INSPECTION': last_inspection.DATE_INSPECTION
}
}]
}]
};