Trying to apply an attribute rule to constrain a feature to a certain length (in the below example 8 character string, yet also trying to do it over a subset of data, in which attributes of another field meet certain criteria (the Feature field)

if ($feature.Feature Includes("PAR", "OVERFL PAR", "SBEUtility")){return (Count(Text($feature.Name)) == 8)}

Essentially, I'm trying to built a definition query into the attribute rule expression to only apply the attribute rule over a portion of the dataset where certain attributes are entered, but I'm struggling with the proper syntax

Also trying to bolster the attribute rule by looking for values that are non-numeric (the field is a text field, but the attribute rule goal is to not have lettered characters.


1 Answer 1


A couple of minor issues. First, your Includes syntax was incorrect. Second, you need to explicitly return true when the constraint doesn't apply.

if(Includes(["PAR", "OVERFL PAR", "SBEUtility"], $feature.Feature )){
    return (Count(Text($feature.Name)) == 8)
} else {
  return true

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.