Hi Team,
I am using ArcGIS Pro V 3.0.3. I am planning to add an Attribute Rule on Feature Class - B to copy value from Field1 of Feature Class - A, based on value from Field2 of Feature Class B.
I would like to add Attribute Rule for Insert trigger only, however, by that time, Feature Class B's new feature may not have value for Field2. So, have to include Update trigger also.
In this scenario, how can we control execution of Attribute Rule only on update of Field2 value of Feature class B and not on any kind of Update.
Thanks in advance!
With Regards,
Vara Prasad
Solved! Go to Solution.
Using the $originalFeature object, you can check to see which attributes are edited. We do this with one of our services, where we want to pass 4 attributes to other layers, but avoid needlessly triggering the rule when other attributes are edited.
if ($originalFeature['some_field'] == $feature['some_field']) {
Console('Key attribute not changed')
// leave feature unchanged
} else {
Console('Key attribute changed, passing update to other layer')
// execute your expression to update the other layer
}
Using the $originalFeature object, you can check to see which attributes are edited. We do this with one of our services, where we want to pass 4 attributes to other layers, but avoid needlessly triggering the rule when other attributes are edited.
if ($originalFeature['some_field'] == $feature['some_field']) {
Console('Key attribute not changed')
// leave feature unchanged
} else {
Console('Key attribute changed, passing update to other layer')
// execute your expression to update the other layer
}
Hi @jcarlson ,
Thanks for the suggestion. This logic is working fine with Update trigger, however, its not working in case of Insert trigger.
So, used below in conjunction with your suggestion.
$editcontext.editType
Thanks & Regards,
Vara Prasad
Oh, good point! There's no "orginalFeature" when it's an Insert. Thanks for amending the expression!