Select to view content in your preferred language

Is it possible to disallow a null attribute with contingent attribute rules?

800
1
12-13-2022 12:12 PM
LLCCG
by
Occasional Contributor

I have a feature class that has an attribute called "status", and another attribute called "approved by". Obviously, when something is in the planning stage, I want "approved by" to remain null. But when the status changes to "approved", I want to require some value in "approved by". 

I don't care what the user puts in that space--there are too many possibilities to create a list of domains. But I do want to require that something is put there. 

Using contingent values, I can require that the "Approved by" value is <ANY> when "Status" changes to approved. But a null value seems to pass the <ANY> test. 

Is there any way to require a value in "Approved by" if and only if "Status" is set to "Approved"? 

Tags (1)
0 Kudos
1 Reply
by Anonymous User
Not applicable

You should be able to build an attribute rule for this. Constraint attribute rules—ArcGIS Pro | Documentation

Something like this might would work:

 

// constraint rule for a field that is non-nullable
// Triggers: Insert, Update
if($feature.status == "Approved") && IsEmpty($feature.ApprovedBy){return false}
return true

 

 

0 Kudos