Creating a required field in ArcGIS
Posted 18 October 2012 - 02:29 PM
I was wondering if anyone knows how to set fields to be either mandatory or optional in an ArcGIS feature class? The only thing I can find any information on, are the required fields (e.g. Object Id, Shape) that are automatically generated upon the creation of a feature class.
I have a data set that has data quality issues, and I want to ensure that when someone adds a point/row to the dataset, the important fields are filled (i.e. I want to make 5 or 6 fields mandatory to enter a value), and make the other fields optional to fill out.
Any help would be much appreciated.
Posted 20 October 2012 - 03:46 PM
Example from ESRI
import arcpy from arcpy import env env.workspace = "C:/data/airport.gdb" arcpy.AddField_management("schools", "ref_ID", "LONG", 9, "", "", "refcode", "NULLABLE", "REQUIRED")
Specifies whether the field being created is a required field for the table; only supported for fields in a geodatabase.
- NON_REQUIRED —The field is not a required field. This is the default.
- REQUIRED —The field is a required field. This means new records must contain a value for the field. Required fields are permanent and can not be deleted.
Edited by AaronP, 20 October 2012 - 03:50 PM.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users