In my last blog post, I recommended that, when possible, data administrators restrict field data entry to domains.
In short, domains behave like drop-down menus (when using Coded Value) that allow users to just select the desired value for a particular field. This helps minimize errors by forcing full value selection versus physical typing of the field attribute.
Domains also promote data consistency by preventing unique spellings of the same word (i.e., Manhole, manhole, MH, etc.).
There are two types of domains:
- Coded Value – Specific list of values. Probably the most common type.
- Range – An allowable numeric range of acceptable values.
Creating and/or modifying a domain is not difficult but does require exclusive, administrative access to the database. Assuming access, conduct the following procedures to create a domain:
- Open up ArcCatalog.
- Navigate to the desired geodatabase. I am working with FieldCollection.gdb.
- Right-click on the geodatabase, and choose Properties (Figure1).
The Database Properties window appears (Figure 2). On the Domains tab, click on the first open box in the Domain Name column and name the domain. In this example, I have named the domain “OverheadUnderground”. The Description column is optional, but may help describe the domain’s purpose.
Specify the field type (i.e., integer, text, etc.) based upon the anticipated assigned field.
Determine whether the domain is a coded value or range. For this example, the domain is a coded value domain.
In the Coded Values section, for each row specify a Code (actually stored in the database for the feature) and a Description (what the user actually sees). The values can be exactly the same for a text field (if desired).
Click the OK button to save and dismiss the Database Properties Window.
Assign the new domain to the desired field(s). Note that the same domain can also be applied to multiple fields in multiple feature classes (assuming they are similar in nature). Right-click the feature class and choose Properties.
In the Feature Class Properties Window (Figure 3), select the Fields Tab and select the desired field to add the domain.
In the Domain drop-down, select the newly created domain and click the OK Button. When doing data entry or modification, the end user can now only select Overhead or Underground for the OHUG field.
From time to time, domains need to be modified. For example, some clients of mine have added the value of “Bridge” to the OHUG domain to reflect when a fiber cable traverses a bridge culvert. To update a domain, conduct the following procedure:
- In ArcCatalog, navigate to the geodatabase, right-click on it, and choose Properties.
- On the Domains tab, find the OverheadUnderground Domain. Go down to the bottom of the list of Coded Values, add Bridge (Figure 4), and click the OK button.
From the Database Properties Window, there is no way to sort the values. So in general, the values will appear to the end user in the order that they are input. There is a hidden gem in the Esri tools that enables the sorting of domains. Conduct the following procedure to add the tool to your tool bar:
- In ArcCatalog, go to the Customize menu, Toolbars option, then click Customize at the bottom.
- In the Customize Window (Figure 5), click the Commands Tab and choose the Data Management Tools Option.
- Click and drag the Sort Coded Value Domain Tool to a toolbar.
- Once added to the toolbar, click it to open the tool window (Figure 6).
- Choose the database that contains the domain to be sorted.
- Choose whether to sort by the domain’s code or the description.
- Select either ascending or descending order.
- Click the OK Button.
- Once sorted, a window will appear informing of completion.
- We now observe that the order has been altered (Figure 7).
In conclusion, have a blast creating and modifying your very own domains! I referenced modifying domains in the Associated Posts below: