Summary
A domain is a declaration of acceptable attribute values. Using domains helps ensure data integrity by limiting the choice of values for a particular field. In some cases, the values are pre-defined in a table and users want to set the values to a domain so that only the values within the domain are valid for the field.
The instructions provided describe how to create a domain from the existing values in a table.
Procedure
1. Use the Summary Statistics tool to calculate the summary statistics for the field in the feature class.
Note:
Ignore if the Error 000800 is displayed.
- In the Catalog window, navigate to System Toolboxes > Analysis Tools > Statistics > Summary Statistics.
- Select the feature class as the input table.
- Select the output table location.
- Select the required field as the statistics field.
- Click the field under the Statistics Type column, and select FIRST from the drop-down list.
- Select the same field as the case field.
- Click OK. A new table is created.
2. Use the Table To Domain tool to create a coded value domain with values from the table.
Note:
Leave Domain Name, Domain Description, and Update Option at default values.
- In the Catalog window, navigate to System Toolboxes > Data Management Tools > Domains > Domain To Table.
- Select the output from the Summary Statistics tool as the input table.
- Select the same field used in the Summary Statistics tool as the code field.
- Select the same field as the description field.
- Select the file geodatabase as the input workspace.
- Click OK.
3. In the Catalog window, right-click the file geodatabase > Properties > Domains tab. Ensure the coded value domain is created successfully.
4. Select the domain.
- In the Catalog window, right-click the feature class to which the domain is assigned in the file geodatabase, and click Properties.
- Click the Fields tab.
- Select the field, click the empty field next to Domain, and select the domain from the drop-down list.
- Click OK.
5. Reload the feature layer in the map, and start an edit session on the feature layer.
6. Open the attribute table of the feature layer, and click the field which the coded value domain is set. The drop-down list is displayed under the field.