I have a Field Maps app that is used to update a tree inventory. The data is stored in an sde database and edited via a branch-versioned feature service. There is an attribute rule that creates a unique id for each tree point using a database sequence (see below). The rule executes on Insert operations only. The first part of the code prevents existing IDs from being overwritten which is useful for cases where a tool like Append is used in Pro.
The problem I'm having is that when editors use the Copy Features tool in Field Maps, the treeID value of the point being copied gets copied to multiple points. The field isn't editable or visible in the Field Maps form (see attached form configuration). However, it appears that the field value is still getting copied, and the attribute rule isn't returning anything since it sees a value in the field. I'm using ArcGIS Enterprise 11.1 and using the form tool in Map Viewer.
Is there a way to prevent this field from being copied with the copy features tool? Or another workaround?
if (!isEmpty($feature.treeID)){
return;
}
var sequence = NextSequenceValue("TREEID");
var prefix = "TREE";
var assetid = prefix + sequence;
return Text(assetid);