Jump to content

 
Photo

Creating a required field in ArcGIS

- - - - -

  • Please log in to reply
2 replies to this topic

#1
ClareS2S

ClareS2S

    Newbie

  • New Member
  • Pip
  • 1 posts
  • Canada

Hi,

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.

Thanks,
C

#2
frax

frax

    Hall of Fame

  • Associate Admin
  • PipPipPipPipPipPipPip
  • 2,308 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Interests:music, hiking, friends, nature, photography, traveling. and maps!
  • Sweden

Isn't this stuff you can do if you use a data model with topology with a geodatabase?
Hugo Ahlenius
Nordpil - custom maps and GIS
http://nordpil.com/
Twitter

#3
AaronP

AaronP

    Newbie

  • Validated Member
  • Pip
  • 9 posts
  • United States

You can specify whether or not fields are required through the Add Field (Data Management) tool. Select the "Field is Required (optional)" check box through the tool itself or add it to an arcpy script:

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

-->