Attribute rule with Update trigger on Same feature class

334
0
05-17-2023 03:55 AM
Labels (1)
VikramAundhekar
New Contributor II

I am trying to create an attribute rule on update where if user updates any particular attribute field then within subnetwork for all devices it should update same attribute field with same value. Written below arcade expression. 

if ($editContext.editType == "UPDATE") {
//we are updating the row, in this table, we need to update details for other too in the table
var id = $feature.subnetworkname;
var gid = $feature.globalid;
var fs = FeatureSetByName($datastore, "ElectricDistributionDevice");
var selectedFeats = Filter(fs, "subnetworkname = @ID And globalid <> @gid");
var destinationRow = Count(selectedFeats);
if (destinationRow == 0) return; //the row exists, time to break the loop (additional logic here can be used to update if they are diffrent )
//the row isn't in the other table, lets add it.
else {
for (var f in selectedFeats){
return {
"edit": [
{
"className": "ElectricDistributionDevice",
"updates": [{
"globalid":f.globalid,
"attributes": {
"comments": "Updated"
}
}]
}
]
}
}
}
}

 

For this expression I am getting error with message, "The Evaluation of rule in cyclic or exceeds maximum cascading levels." Error image attached. I need help to resolve this error. Thank you.

VikramAundhekar_0-1684320654012.png

 

0 Kudos
0 Replies