Select to view content in your preferred language

Required field parameter not working

345
4
Jump to solution
04-10-2025 08:00 AM
Labels (3)
ChaceCarpenter
Emerging Contributor

I created a feature class with  a required field, but there is an issue. When I add a feature and I don't fill this field; the system lets me add the feature even though the required field is empty. I want any feature that is added to the data set to always have this field filled for data quality reasons. Ps, I am working in a local geodatabase if that matters. It seems that making a field required only makes it so the field cant be deleted. Is there a way to prevent the creation of a feature if a field isn't filled?

0 Kudos
1 Solution

Accepted Solutions
Robert_LeClair
Esri Esteemed Contributor

There's a couple workflows that would get you close:

1.  You can configure the feature template to prompt for attributes on 1 or more attribute fields.  Unfortunately, this would still allow for NULL values.  Configure a feature template—ArcGIS Pro | Documentation
2.  If features already exist in the feature class to be edited, you cannot uncheck the "Allow Nulls" item in the Fields Designer  FAQ: Is It Possible to Uncheck the Allow NULL Check Box When Editing the Attribute Table i
3.  If you can recreate the feature class with no data in it - then yes, you can configure a field to not allow NULL values - Problem: Unable to Configure Fields to Ensure Null Values Are Not Allowed in ArcGIS Field
4.  You could create a constraint attribute rule that does not allow for Null values - Attribute rule script expression examples—ArcGIS Pro | Documentation

View solution in original post

4 Replies
DanPatterson
MVP Esteemed Contributor

short of doing a query on the required field for any value that is not None and using the GetCount tool (which should return a 0 value if there is nothing there)  

Get Count (Data Management)—ArcGIS Pro | Documentation

The question becomes, why do you want a required field prior to creating a feature and putting a value in it?  Perhaps elaborating on the requirement would help


... sort of retired...
ChaceCarpenter
Emerging Contributor

I want to make sure others users cant add a feature without filling this field. Its a field that should never be blank. So I was trying to validate the data that other user may enter into the dataset

0 Kudos
Robert_LeClair
Esri Esteemed Contributor

There's a couple workflows that would get you close:

1.  You can configure the feature template to prompt for attributes on 1 or more attribute fields.  Unfortunately, this would still allow for NULL values.  Configure a feature template—ArcGIS Pro | Documentation
2.  If features already exist in the feature class to be edited, you cannot uncheck the "Allow Nulls" item in the Fields Designer  FAQ: Is It Possible to Uncheck the Allow NULL Check Box When Editing the Attribute Table i
3.  If you can recreate the feature class with no data in it - then yes, you can configure a field to not allow NULL values - Problem: Unable to Configure Fields to Ensure Null Values Are Not Allowed in ArcGIS Field
4.  You could create a constraint attribute rule that does not allow for Null values - Attribute rule script expression examples—ArcGIS Pro | Documentation

ChaceCarpenter
Emerging Contributor

Thanks! I went with workflow 4