I use attribute rules to populate fields as features are created or updated, often based on other layers. For example, we have an operational layer that divides the city into 5 regions. Each region has a different inspector, and occasionally the boundaries change. When those boundaries change, I need to be able to update the layer(s) that depend on those boundaries.
Does anyone have a succinct way of dealing with this?
The best I've got at the moment is to delete the attribute rule, run the calculation manually with Field Calculator, and then reapply the attribute rule.
If anyone finds this and just wants my script, here you go (modified for the common use of an address layer grabbing the zip codes).
var z = FeatureSetByName($datastore, 'geo.sde.Zip_Codes', ['zip'], false);
var y = First(Intersects($feature, z));
if (y == null) return;
return y.zip;