HOW TO
In Map Viewer, duplicate-value validation can be applied to ensure data integrity and prevent users from entering repeated values in key identifier fields. This article provides the workflow to detect duplicate entries using Arcade by populating 'Duplicate' in the form-calculated field.
Note: Ensure an empty string field is created for the Arcade expression configuration before attempting the workflow provided. Refer to ArcGIS Online: Add a field or Portal for ArcGIS: Add a field for more information.
var features = FeatureSetByName($datastore, '<feature_layer_name>', ['<field_name>', 'OBJECTID'], false);
for (var i in features) {
if ((i.<field_name> == $feature.<field_name>) && (i.OBJECTID != $feature.OBJECTID)) {
return "Duplicate";
}
}
return "Accepted";
The code below demonstrates the full working script.
var features = FeatureSetByName($datastore, 'Test', ['Asset_ID', 'OBJECTID'], false);
for (var i in features) {
if ((i.Asset_ID == $feature.Asset_ID) && (i.OBJECTID != $feature.OBJECTID)) {
return "Duplicate";
}
}
return "Accepted";
The map shows 'Duplicate' populated when a record with the duplicate asset ID is specified and a new feature is created.

Article ID: 000035700
Get help from ArcGIS experts
Start chatting now