I am testing validation rules. We have imported a lot of data and I want to implement validation rules to assist users in reviewing attribute values that need to be in the attribute domain. I am using ArcPro 3.2+. (I know I can do this from with the Attributes tab but want to use attribute validation rules. )
I have a domain with ALL county values 1-36 for a field called County. In my feature class (Taxcode) I selected a polygon and assigned it a null value (putting it outside the domain). I have created a couple of different arcade scripts to do the validation but both return all features in error when using the error inspector. I have looked at available examples and can not find this specific example. I did find code that looks at pole heights and another that includes subtypes. I have not been successful at using these examples to create my own SIMPLE approach. Here are the two ways I have done it.
Example 1:
return (Includes(Domain($feature,'County').codedvalues,$feature.County))
Example 2:
var CountyDomains = Domain($feature,'County')
var ValidCodes = []
var ValidCodes = CountyDomains["codedValues"]
return (Includes(ValidCodes,$feature.County))
Both are valid expressions. In the error inspector both identify all features in the feature class as being in error. Its got to be doing something simple. What am I doing wrong?