HOW TO
In ArcGIS Pro, the attribute table may contain both unique and common values. Sometimes only unique values are allowed in a column to ensure there is no duplicate value for a particular field, such as employee IDs.
In this article, an attribute rule is used to populate the term 'Duplicate' when a field is populated with the same value as another record. This method is useful in ensuring no duplicate records are created in the attribute table.
Note: The attribute rule to identify duplicate field values in the attribute table only works for a text field.
Note: The dataset requires Global IDs to add an attribute rule.
var features = FeatureSetByName($datastore,'<feature_class>', ['<field_name>'], false); for(var i in features) if((i.<field_name> == $feature.<field_name>) && (i.OBJECTID != $feature.OBJECTID)) { return "Duplicate";} return $feature.<field_name>;
The image below demonstrates the term Duplicate is populated when a record with the duplicate employee ID is created in the attribute table.
Article ID: 000029088
Get help from ArcGIS experts
Download the Esri Support App
You can also download the app to access the chatbot anytime! Download it now.