0

I'm trying to add some conditional acceptance criteria for an ArcGIS Pro attribute rule.

Basically, I have a feature class with a domain-restricted field (Feature) that has a few values ("PAR", "OVERFL", "SBE") that warrant the need to have values entered to the (Name) field.

Trying to beef up this constraint attribute rule to allow null values, at least temporarily, such that a user can assign values to the Feature field and then assign values to the Name field. Otherwise, a user would have to assign unique Name values first, then tag the Feature values to avoid an immediate constraint error, which can be very sensitive

I've played around with a few expressions, but either get a "BOOL type expected" error or the rule fails to ignore nulls, even with if((!IsEmpty($feature.Name) entered alternatively, to return the opposite of null.

// Settings needed
var parcels = FeatureSetByName($datastore, "Parcel",['Name'], false); //change the parcel table name to your feature class name
var parcelName = $feature.Name;
var sql = "Name = " + "'" + parcelName + "'";
var SameNameParcels = Filter(parcels, sql);
if((IsEmpty($feature.Name) == False) & Includes(["PAR", "OVERFL", "SBE"], $feature.Feature )){
    return (Count(SameNameParcels)==1)
} else {
  return true
}

1 Answer 1

0

I was able to figure it out. Just needed research on how to combine conditions to one If statement in arcade with "&&". This is because AND was not working for me.

// Settings needed
var parcels = FeatureSetByName($datastore, "Parcel",['Name'], false); //change the parcel table name to your feature class name
var parcelName = $feature.Name;
var sql = "Name = " + "'" + parcelName + "'";
var SameNameParcels = Filter(parcels, sql);
if((Includes(["PAR", "OVERFL", "SBE"], $feature.Feature )) && (!IsEmpty($feature.Name))){
    return (Count(SameNameParcels)==1)
} else {
  return true
}

Thanks!!

Your Answer

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

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