expression valid this time but: ERROR 002717: Invalid Arcade expression, Arcade error: Table not found DirectProtectionAreas21_2, Script line: 12 [DirectProtectionAreas21_2]
Failed to execute (AddAttributeRule).
// Calculation rule
// Suppression_repair_points, field DPA_AGENCY
// Triggers: Insert, Update
// optional:
// if DPA_AGENCY is already filled, just return its value (do nothing)
//if(!IsEmpty($feature.DPA_AGENCY)) {
// return $feature.DPA_AGENCY
//}
// load the polygon fc
var dpa_fc = FeatureSetByName($datastore, "DirectProtectionAreas21_2")
// intersect the feature with the polyons
var dpa_inter = Intersects(dpa_fc, $feature)
// if the feature doesn't intersect a dpa polygon, return null
if(dpa_inter == null || Count(dpa_inter) == 0) {
return null
}
// grab the first intersecting polygon and return its DPA_AGENCY value
return First(dpa_inter).DPA_AGENCY