HOW TO

Identify a duplicate field value using an attribute rule when editing the attribute table in ArcGIS Pro

First Published: January 10, 2023
Last Published: July 16, 2026

Summary

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.

Procedure

Note:
The attribute rule to identify duplicate field values in the attribute table only works for a text field.
  1. Open the ArcGIS Pro project.
  2. In the Catalog pane, browse to and right-click the feature class, and click Manage.
  3. In the Feature Class Properties dialog box, in the Manage section, check the Global IDs check box and click OK.
Global IDs enabled for the feature class
Note:
The dataset requires Global IDs to add an attribute rule.
  1. Right-click the feature layer in the Contents pane and click Data Design > Attribute Rules.
  2. Click the Add Rule drop-down list and select Immediate Calculation.
  3. Specify Rule Name. In this example, Test Rule is used.
  4. For Field, select the field to use. In this example, EmployeeID is used.
  5. Insert and configure the expression below in the Expression box.
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>;
  1. Replace <feature_class> with the name of the feature class containing the field to check for duplicate values. In this example, Workforce is used.
  2. Replace <field_name> with the name of the field in the attribute table to check for duplicate values. In this example, EmployeeID is used.
  1. Under Triggers, check the preferred options. In this example, Insert and Update are checked.
Attribute rule to identify duplicate field values
  1. On the Attribute Rules tab, in the Manage Edits group, click Save.

The attribute table below demonstrates the term Duplicate is populated when a record with the duplicate employee ID is created.

Attribute rule populated by the term Duplicate

Article ID: 000029088

Software:
  • ArcGIS Pro

Get support with AI

Resolve your issue quickly with the Esri Support AI Chatbot.

Start chatting now

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Start chatting now

Go to download options