ArcGIS Blog

Data Management

ArcGIS Pro

Create domains and contingent values from existing data

By Diana Muresan

In recent releases (ArcGIS Pro 3.3 and 3.4) we’ve been looking at ways to speed up common schema creation and editing workflows. Two features that go hand in hand are the ability to auto-generate attribute domains and contingent values. In this blog we’ll look at a workflow that includes both to demonstrate how you can increase your productivity and save a significant amount of time getting domains and contingent values set up.

This example follows the GIS department of a city as they embark on a project to audit and rename the city’s local streets. During this process, Andy, the GIS lead signaled inconsistencies in how street characteristics have been recorded by the editors. Certain street types have been entered with varying formats, such as “Ave,” “Avenue,” or “Av.”

To standardize street attributes to a predefined list, Andy will apply attribute domains to the Street feature class. To streamline the data entry, the department wants to further refine the choices for the number of lanes and speed limit to be restricted based on the selection of the street type. For this, they will also apply contingent values.

Rather than creating these values one by one in their respective views, he will use the newly included tools in ArcGIS Pro to generate these domains and contingent values from the department’s existing street data.

He focuses on three fields in the Street feature class:

  • Road type
  • Number of lanes
  • Speed limit
Street feature class - Fields view
Street feature class - Fields view

He starts by applying attribute domains to these three fields.

Generate attribute domains

In the Fields view of the Street feature class Andy locates the first field of interest, Road type. Then from the Domain column, he uses the drop-down list to choose between the two options:

  • Add New Coded Value Domain­­­—Create the values manually, one by one, in the Domain view.
  • Add New Coded Value Domain From Existing Field Values—Create values automatically from existing data.  Because he wants to speed up the domain creation process, he goes with the second option and generates attribute domains from the existing street data.
Apply attribute domains to the Road Type field
Apply attribute domains to the Road Type field

The Domains view opens with the newly created domain for the Road type field. Both the coded values and the descriptions have been automatically generated from the existing road type attributes. The domain name and description are also auto-generated from the Fields view details.

The GIS lead further adjusts the resulting values to make it relevant to the road data.

Road type domain values
Road type domain values

In this example, both street formats of “Avenue” and “Ave” appear in the domain list. This is because the domain values were generated from existing data, which had inconsistencies. To impose only one format, the GIS lead deletes the “Ave” value. This ensures the data is recorded in one consistent format.

Delete incorrect domain value
Delete incorrect domain value

The GIS lead follows the same steps to generate attribute domains for the Speed limit and Number of lanes fields. Not only to restrict the valid values for these fields, but also to set them up to participate in contingent values. These are numeric field types, therefore the domains can be either coded value domain or range domain and can be generated in the same fashion.

Add domain for the Speed limit field
Add domain for the Speed limit field

When finished, all three fields will have domains applied, as shown in the screenshot below.

All three fields have attribute domains assigned
All three fields have attribute domains assigned

Next, to make it easier for editors to find and select the appropriate domain values from the list of values, Andy will order the domain value list alphabetically.

Sort domain values

Going back to the Road Type domain, the department wants all the road type attributes listed in alphabetic order. They also want to add another value to symbolize retired and repurposed street segments as closed. Because the situations in which a street is declared closed are rare, the department wants this value to be displayed last in the domain value list.

Road type domain values
Road type domain values

To address this request, Andy uses the Sort Coded Value Domain geoprocessing tool. The tool sorts the code or description of a coded value domain in either ascending or descending order.

Sort Coded Value Domain geoprocessing tool
Sort Coded Value Domain geoprocessing tool

In this example he chooses to sort in ascending order, so the values in the Road Type domain are listed alphabetically.

Road type domain values ordered alphabetically
Road type domain values ordered alphabetically

To ensure the less used values remain at the bottom of the domain list, he adds the “Closed” value after the domain list has been sorted alphabetically.

By using the Click here to add coded value option the “Closed” domain value added manually after sorting the list maintains its position as the last value after saving the edit. Editors can quickly locate the desired value without having to scroll through an unsorted or randomly ordered list, which ultimately speeds up the editing process.

Road type domain values
Road type domain values

To streamline data entry while editing on the Street feature class, Andy uses contingent values—data design tools that create a decision tree effect. Selecting a value in one field filters valid options in related fields. For example, if the road type is “Avenue,” then number of lanes is limited to 1 or 2 and the speed limit to 25 mph. So contingent values are applied to the road type, speed limit, and number of lanes fields.

Generate contingent values

The first step is to create a field group in the Contingent Values view. Andy creates a new field group named “Street Maintenance” and adds the Number of lanes, Road type, and Speed limit fields to it. He also keeps the restrictive option enabled.  This means that values entered on any of these three fields are restricted to those specified as contingent values.  Any features with values not defined as valid combinations within the field group cannot be saved.

Create a new field group in the Street feature class
Create a new field group in the Street feature class

Once the field group is created, he can create the values one by one in the view.

Create contingent values manually in the view
Create contingent values manually in the view

But to speed up the creation process, he will use the Generate option on the ribbon.

The Generate Contingent Values option on the ribbon
The Generate Contingent Values option on the ribbon

Starting with ArcGIS Pro 3.4, contingent values can be automatically generated without manual input. Similar to the workflow above where domains were auto-generated, this tool allows you to create values from existing data or existing schema. If you choose to generate based on data, the values already present in the input table will be used to generate valid contingent values. If you choose the schema option, the coded values of all domains assigned to the field group’s fields will be used to generate all possible contingent value combinations.

In this example, the GIS lead uses the Schema mode to generate the contingent values.

Generate contingent values from schema
Generate contingent values from schema

Once he clicks OK, all possible values are generated in the Contingent values view.

Newly generated combination of values
Newly generated combination of values

Similar to the domain values, he reviews the generated values and adjusts the list to better reflect the nature of the data by deleting, editing, or adding new contingent values.

Clean up combination of values
Clean up combination of values

When the review process is done, Andy saves the edits. Next, the editor tests the editing experience ensuring the attribute domains and the contingent values have been correctly set up.

Editing experience

The department’s GIS editor, Herta, is the editor that has been first assigned to use the street data for testing.

Herta attempts to create a new street segment, but an error message appears in the Create Features pane informing her that the feature cannot be created until the attribute values satisfy the contingent values in place. This is because Andy set up the contingent values as restrictive during the creation process. This means that editors cannot save their changes until the correct attributes for the highlighted fields are filled based on a valid combination of contingent values.

Warning message during data editing
Warning message during data editing

To clear the error, Herta will make use of the predefined list of contingent values to make her selection. For the road type she chooses “Avenue”.

Fill in the Road type field
Fill in the Road type field

Next, for the number of lanes specific to the Avenue Road type, her previous choice, there are only two valid options: one or two lanes. She chooses the value “2”.

Fill in the Number of lanes field
Fill in the Number of lanes field

Finally, for an Avenue Road type with two lanes there is only one valid speed limit option. And that is 25.

Fill in the Speed limit field
Fill in the Speed limit field

The valid combination of values clears the error message and Herta can save her edits. Because attribute domains and contingent values have been applied to the Street feature class, Herta was able to create a new street segment without much manual input, which speeds up the editing process.

Contingent values requirements have been met
Contingent values requirements have been met

With the latest ArcGIS Pro tools, attribute domains and contingent values can be automatically derived from existing datasets so you can streamline schema setup, reduce manual data entry, and minimize errors. This approach not only saves time but also ensures consistency across your data model—especially in projects where standardization is key.

Check out additional resources on how to work with attribute domains and contingent values on the Geodatabase Resources Hub.

Share this article