Add Field (Data Management Tools)
Summary
Adds a new field to a table or the table of a feature class or feature layer, as well as to rasters with attribute tables.
Usage
Caution:
This tool modifies the input data. See Tools that modify or update the input data for more information and strategies to avoid undesired data changes.
For shapefiles and dBase tables, if field type defines a character, blanks are inserted for each record. If field type defines a numeric item, zeros are inserted for each record.
The Field Length parameter is only applicable to fields of type text. If no field length is provided, a length of 255 will be used.
For geodatabases, if field type defines a character or number, <null> is inserted into each record if the Field supports null values parameter is checked.
A nonnullable field cannot be added to a nonempty geodatabase feature class or table.
A shapefile does not support aliases for fields, so you cannot add a field alias to a shapefile.
You can use an existing domain from a feature class in a geodatabase for the Field Domain parameter value. The name of an existing domain must be provided. Providing an invalid domain name or value will not cause the tool to fail, but the invalid name or value will be ignored and no domain will be set for the field.
The precision and scale of a field represent the maximum precision and size of data that can be stored in the field. The precision represents the number of digits that can be stored in the field, and the scale represents the number of decimal places for float and double fields. For example, for a value of 54.234, the scale is 3 and the precision is 5.
Note:
Field precision and scale are not supported in a file geodatabase feature class or table. If you provide a value for precision or scale, it will be ignored.
For other database types, use the following guidelines to choose the correct field type for a given precision and scale:
When you create a float or double field and specify a precision and scale, if the precision is greater than 6, use a double; otherwise, use a float.
For a field with a scale of 0, use a long or short integer field type. When creating a long integer field, specify a precision of 10 or less, or the field may be created as a double.
Required fields are permanent and cannot be deleted. To allow for deletion at a later time, set the field so it is not required (the default).
A field of type raster allows you to include a raster image as an attribute. It is stored in or alongside the geodatabase. This is helpful when an image is the best way to describe a feature. Precision, scale, and length cannot be set for fields of type raster.
Parameters
| Label | Explanation | Data type |
|---|---|---|
|
Input Table |
The input table where the specified field will be added. The field will be added to the existing input table and will not create a new output table. Fields can be added to feature classes in geodatabases, shapefiles, coverages, stand-alone tables, raster catalogs, rasters with attribute tables, and layers. |
Mosaic Layer; Raster Layer; Table View |
|
Field Name |
The name of the field that will be added to the input table. |
String |
|
Field Type |
Specifies the field type of the new field.
|
String |
|
Field Precision (Optional) |
The number of digits that can be stored in the field. All digits are counted regardless of which side of the decimal they are on. This parameter is only applicable to numeric field types. If the input table is in a file geodatabase, the field precision value will be ignored. |
Long |
|
Field Scale (Optional) |
The number of decimal places stored in a field. This parameter is only applicable to fields of type float or double. If the input table is in a file geodatabase, the field scale value will be ignored. |
Long |
|
Field Length (Optional) |
The length of the field. This sets the maximum number of allowable characters for each record of the field. If no field length is provided, a length of 255 will be used. This parameter is only applicable to fields of type text. |
Long |
|
Field Alias (Optional) |
The alternate name for the field. This name is used to describe cryptic field names. This parameter only applies to geodatabases. |
String |
|
Field supports null values (Optional) |
Specifies whether the field can contain null values. Null values are different from zero or empty fields and are only supported for fields in a geodatabase.
|
Boolean |
|
Field is required (Optional) |
Specifies whether the field being created is a required field for the table. Required fields are only supported in a geodatabase.
|
Boolean |
|
Field Domain (Optional) |
Constrains the values allowed in any particular attribute for a table, feature class, or subtype in a geodatabase. You must specify the name of an existing domain for it to be applied to the field. |
String |
Derived output
| Label | Explanation | Data type |
|---|---|---|
|
Updated Input Table |
The updated input table. |
Table View; Raster Layer; Mosaic Layer |
Environments
Licensing information
- Basic: Yes
- Standard: Yes
- Advanced: Yes