I am trying to sieve out duplicate values within the column "ID" from the table "IDs" and am getting different results for using the same arcade expression with Calculate Field tool and Validation Rule. The expression gives the intended output for the Calculate Field tool but Validation Rule outputs Error 002717, at line 3, where it seems to suggest that it is unable to read the ${id} variable. I have also tried the method of adding the string with the variable id to no avail.
var tbl = FeaturesetbyName($datastore, "IDs", ["ID"], false);
var id = $feature.ID
var query = `ID = ${id}`;
var countID = Count(Filter(tbl, query));
function isDup(value){
if (value > 1){
return false;
} else {
return true;
}
}
isDup(countID)