I am trying to create an attribute rule that updates the GIS_PropertyAcres field across all features that all share a common Parent Property ID when the geometry of a feature is updated. I am constantly getting a Does anyone know how to modify the following code to prevent this error from occurring?
//Creates empty array and counter for iterating
var updates = []
var counter = 0
var id = $feature.ParentPropertyID
var fs = Filter($featureset, "ParentPropertyID = <a href="https://community.esri.com/t5/user/viewprofilepage/user-id/354972">@ID</a>")
var newacres = Sum(fs, "GIS_TractAcres")
var new_shape_area = $feature.Shape_Area
var old_shape_area = $originalfeature.Shape_Area
var cnt_poly = count(fs)
if (new_shape_area != old_shape_area){
for (var f in fs){
updates[counter] = {
'globalid': f.GlobalId,
'attributes':{
'GIS_PropertyAcres': newacres,
}
}
counter++
}
return {
'edit': [{
'className': 'Arcade_Rules_Test',
'updates': updates
}]
}
}
else {
return $originalfeature.GIS_PropertyAcres
}
