Hi.
In one of my users workflows, they need to append a selection of features to a featureclass and I've created a pythonscript for doing this (appending data and corresponding field-mapping). The process of selecting features and appending might be done several times in the workflow, if the user sees the need to add more features.
I see that some users might add the same feature several times, causing duplicate features in the featureclass and this genrerates problems further down in the workflow. To restrict adding duplicate feature I've tried creating a contraint attribute rule. This attribute rule actually returns a message saying that features with same geometry is not allowed, but it inserts the feature multiple times.
Do you see what might be wrong?
var vegteig = FeatureSetByName($datastore, "Vegteiger")
var isUnique = true;
for(var p in vegteig){
if(Equals(Geometry($feature), Geometry(p))){
isUnique = false;
break;
}
}
return isUnique
Maybe look into the following scripts