Hello, im trying to create an immediate calculation(triggered on insert) that will take the date field of an inspection from the related table of the parent point hydrant feature into the hydrant's most recent inspection date field. Its an SQL database and im using pro 2.8.2. I havent had a chance to set up environment to test but I just wanted to ask if im going in the right direction. Thank you!
Var inspection_date = $feature.workdate
Var related_Hydrants = FeatureSetByRelationshipName($feature, "Hydrant_Maintenance")
Var inspected_Hydrant = First(related_Hydrants)
return {
"result": inspection_date,
"edit": [
{
"className" : "related_Hydrants",
"updates" : [{
"globalID" : inspected_Hydrant.GlobalID,
"attributes": {
'Flush_Date': inspection_date
}
}]
}]
}