Create and manage contingent values

Contingent values, sometimes referred to as contingent attribute values, are a data design feature that allows you to make values in one field dependent on values in another field. Attribute domains allow you to restrict the valid entries in a field to a set list or range of values. Contingent values extend this model by making your choice for a value on one field further constrain the domain values that can be placed on another field. In this way, contingent values enforce data integrity by applying additional constraints to reduce the number of valid field inputs. This can be useful when modeling real world parts and assets in a GIS, particularly for utility companies. This can also be useful for creating decision trees or survey questions when making a choice will determine the next set of valid choices.

Caution:

Creating contingent values on a table or feature class makes it incompatible with ArcMap and releases earlier than ArcGIS Pro 2.3 and ArcGIS Enterprise 10.7.x. See Client and geodatabase compatibility for more information about available functionality when using mixed client and geodatabase releases.

A relatable example for an application of contingent values is buying a vehicle.

The decision tree may look like this: Pick a Car Brand > Car Model > Trim Level > Color

Car buying decision tree

  • First you choose the car brand, for example, Honda.

    Choose a car brand.

  • Based on that brand, a number of car models are available.

    • For Honda, these can be Pilot, CRV, Accord, and Civic.

      Choose a car model.

    • For Toyota, a different list of car models is available.

      Choosing a different car brand offers a different list of car models.

  • Then, based on the car model you choose, a number of trim levels are available.

    • For a Honda Pilot, these can be LX, EX-L, Sport, and Touring.

      Choose a trim level.

  • For the trim level you choose, a number of colors are available, such as Red, Blue, Black, and White.

    Choose a color.

Each choice in the decision tree presents a list of options contingent on what you've chosen previously. Choosing a different car brand will result in a different set of available car models. The car model you choose dictates which trim levels are available, and each trim level may have a different set of color options. Your choices can result in a Honda > Pilot > EX-L > White, or a Toyota > 4Runner > TRD Sport > Inferno, depending on which option you choose at each stage.

Contingent values allow you to set up these types of field dependencies in your data in which your choice for a value in one field defines and restricts the list of valid values for another field.

For a real-world GIS example, consider the StructureJunction feature class in the utility network asset package. There is a point feature class for structure junctions that has subtypes for assets such as power poles, manholes, platforms, and so on.

Pole subtype with domains assigned to its fields

For the Pole subtype, domains have been applied to three of the fields. The domains constrain the values that can be placed on each field to a list of valid values. For example, a pole can be of pole class 1, 2, or 3; a pole's material can be fiberglass, wood, or steel; and a pole's height can be 30 feet, 35 feet, 40 feet, 45 feet, and so on.

To further constrain the valid values for this set of fields, you can use contingent values. For example, using contingent values, you can define a class 1 pole as being made only of the material fiberglass and restricted to only 30, 35, 40, or 45 feet in height.

Consider the contingencies that you want between field values for the Pole subtype. For this group of fields (class, material, and height), the set of contingencies can be as follows:

FieldContingent valuesContingent valuesContingent values

Class

1

2

3

Material

Fiberglass

Wood

Steel

Height

30, 35, 40, 45

30, 35, 40, 45

50, 55, 60, 65

After these contingent values are created, if you place a new pole feature or modify an existing one, and designate it a Class 1 power pole, the set of values that you can place on the Material field will be constrained to Fiberglass. Likewise, the valid values for the height of a Class 1 Fiberglass pole are constrained to 30, 35, 40, or 45.

Building contingent values like this in your data allows you to further constrain the valid values for sets of fields and more efficiently manage the validity and integrity of your data.

Prepare data for contingent values

Contingent values are created for groups of fields in a table or feature class. Before creating contingent values, these fields should be set up with appropriate domains containing a list, or range, of valid values.

In the power pole example above, the contingent values are in a group of three fields: Class, Material, and Height. Each field has an appropriate domain assigned. For example, the Material field has a domain for materials of types Fiberglass, Wood, and Steel. Once you've properly set up domain values, assigned the domains to their respective fields, and determined the group of fields to create contingencies on, you must create the contingencies between the domain values.

To create contingent values on a table or feature class, you must do the following:

  • Create domains with a list or range of valid values.
  • Assign those domains to the appropriate fields of a feature class or table.
  • Open the Contingent Values view on that feature class or table.
  • Create a field group containing the fields that will have contingent values.
  • Create contingent values across the fields in that field group.

Note:

When a many-to-many or attributed relationship class is created, a new intermediate relationship class table is created. This intermediate relationship class table is not an object class. As a result, domains, subtypes, contingent values, attribute rules, and default values cannot be used with this type of table.

Open the Contingent Values view

The Contingent Values view is where you create, delete, and manage contingent values.

You can open the Contingent Values view by doing any of the following:

  • Right-click a table or feature class in the Catalog pane, point to Data Design, and click Contingent Values.
  • Right-click a table or feature class in the Contents pane, point to Data Design, and click Contingent Values.
  • With a layer selected in the Contents pane, click the Contingent Values button on the Data tab in the Feature Layer tab set. With a table selected in the Contents pane, click the Contingent Values button on the Standalone Table tab. For both a layer and a table, the view switches to the Contingent Values view.
  • In the Fields view, Subtypes view, or Attribute Rules view, click the Contingent Values button in the Data Design group. The view switches to the Contingent Values view.
Note:

The first time you open the Contingent Values view on a table or feature class, no contingent values are set, and you are prompted to create a field group first.

Contingent Values view

The Contingent Values view has a tab for creating and managing contingent values and buttons for switching to the other data design tabs.

Contingent Values tab

The Contingent Values tab contains the following groups:

  • Clipboard provides the standard clipboard options for Paste, Copy, Cut, and Delete.
  • Data Design provides the following buttons to open the other data design view:
    • Fields
    • Subtypes
    • Domains
    • Attribute Rules
    • Field Groups—Provides a button to open the Field Groups dialog box.
  • Contingent Values provides the following buttons to create and manage contingent values:
    • New—Adds a row to create contingent values on the fields from an active field group in the view.
    • Import—Imports field groups and contingent values from a comma-separated values (.csv) file.
    • Export—Exports field groups and contingent values to a .csv file.
    • Retire Value—Allows you to set the highlighted row as a retired contingent value. Retired values are still visible in other places in the user interface, such as a fields value in the Attribute pane, but they are not selectable.
    • Toggle Value IDs—Displays or hides the Value ID value in the data grid.
    • Toggle Code/Description—Switches the display between domain code or description in the data grid.
    • Save—Saves all changes made in the Contingent Values view. Changes are kept in memory until you click Save.

Create a field group

Before creating contingent values across the fields of a feature class or table, you must create a field group. A field group is a named collection of fields in a table or feature class. In the power pole example above, a field group consists of pole class, material, and height. Once a field group is created, you can assign contingencies to the field values in that group.

To create a field group, do the following:

Play Video

  • Video length: 0:52
  • This video was created with ArcGIS Pro 3.2.
  1. Click the Field Groups button on the Contingent Values tab.

    The Field Groups dialog box appears.

  2. In the Name section, click the Click here to add a new field group text.

    A new field group named Field_Group is created. You can rename this field group.

  3. Click the Add Fields drop-down menu.

    All of the fields in the table or feature class are listed.

  4. Choose the fields you want included in the field group and click the Add button.
    • Use the Search text box at the top of the list to find a specific field.
    • To add all of the fields to the field group, click Select All, and click Add.
  5. Optionally, uncheck the Restrictive check box.
    • Checked—A restrictive field group is created, and values entered on a field in the field group are restricted to those specified as contingent values. Field groups are restrictive by default to allow control of the editing experience when using contingent values.
    • Unchecked—Disable the restrictive setting. When this is unchecked, the field group created is not restrictive, which allows values to be committed to a field group even if they are not specified as contingent values.
  6. Click OK to create the field group.

Tip:
You can use the following shortcut keys on your keyboard to explore the Fields Group dialog box:
  • Ctrl+N—Create a field group.
  • Alt+G—Place the pointer in the Field group data grid at the top of the dialog box.
  • Alt+A—Place the pointer in the Add Fields drop-down menu.
  • Alt+F—Place the pointer in the Fields data grid at the bottom of the dialog box.

Create contingent values

Once a field group created is created, you can create contingent values for the participating fields.

If the table or feature class you are working with in the Contingent Values view has multiple field groups associated with it, you can switch between them by clicking the Field Group drop-down menu and selecting another field group.

If the table or feature class you are working with in the Contingent Values view has subtypes, you can switch between them using the Subtypes drop-down menu. This allows you to set up contingent values differently for the fields of each subtype. Ensure that any domains are applied on the fields at the subtype level in the Subtypes view before starting.

To create contingent values in a field group, complete the following steps:

  1. Click the New button in the Contingent Values group, or click in the empty row where it says Click to add contingent values.
  2. For each field in the field group, choose a field value from the drop-down menu.

    The values <ANY> and <NULL> are also available to add as contingent values in the drop-down menu. <ANY> is always available—even if the field where you're adding a contingent value doesn't have a domain applied—and <NULL> is available when the field allows null values.

    • <ANY>—Adding the contingent value <ANY> means that any value placed on the field is considered valid.
    • <NULL>—Adding the contingent value <NULL> means that having a null value placed on the field is considered valid.

  3. Repeat steps 1 and 2 for all the contingent values you are creating.
  4. Note:
    If you have a subtype applied, the contingent values apply only for the subtype listed. To apply contingent values to other subtypes, click the Subtype drop-down arrow, choose another subtype, and repeat the steps above.
  5. When you're finished, click Save to save your changes.

For the pole example above, in a field group named Poles Contingency, the set of contingent values are as follows:

Contingent values for the Pole example

Once you have contingent values prepared for the data, the restrictions you've created are enforced in the application whenever a value is placed in a field while editing, such as in the Attribute pane or the Attribute Table view.

Learn more about how to edit fields with contingent values

Retire a contingent value

You can retire a contingent value. When you retire a contingent value, it still appears in the list of valid values for a field in places such as the Attribute pane, but it is unavailable and you can't select it as a field value. For example, your organization is no longer using asbestos as a building material, but there are places where asbestos has been used on current assets. This means that it's still a valid value that may exist in the field for building material for some features, but you won't be using it anymore. To keep it from being used in any more fields, you can retire the value.

To retire a contingent value, select the row you want to retire and click the Retire Value button in the Contingent Values group.

To unretire a contingent value, select the retired row, and click the Retire Value button.

Copy contingent values between datasets

Once contingent values are established for a dataset, you can add them to another dataset. You can copy contingent values between datasets in the following ways:

  • Copy and paste
  • Export and import contingent values

Copy and paste

Copy and paste in the Contingent Values view is supported using keyboard shortcuts, the context menu, and the clipboard. Prerequisites for copy and paste workflow include that the destination dataset must have a field group and the field group must include matching field data types and domain applied to the fields.

To copy contingent values from one dataset to another, complete the following steps:

  1. Open the Contingent Values view on the origin dataset that contains the contingent values of interest and the destination dataset where the contingent values will be copied.

    The Contingent Values view opens for the origin and destination datasets.

  2. From the origin dataset, select the contingent values to copy to the destination dataset.

    The contingent values are selected.

  3. Copy the selected contingent values using copy from the Clipboard, the keyboard shortcut for copy, or copy from the context menu.
  4. In the destination dataset, select the field group that contains the matching field data types with the matching domains applied to the fields and paste the contingent values using paste from the Clipboard, the keyboard shortcut for paste, or paste from the context menu.
  5. Click the Save button Save on the Contingent Values tab.

    The contingent values are saved in the destination dataset.

Export and import contingent values

Exporting and importing can be useful when sharing contingent values and field groups for a table or feature class, creating a backup, or updating a production database without locking it extensively for schema editing. As a part of exporting contingent values from a dataset, two comma-separated values files (.csv) are created. The field group .csv file contains metadata and information about the participating fields, and the contingent values .csv file contains metadata and the contingent value combinations.

Export contingent values

You can use the Export button in the Contingent Values group on the Contingent Values tab or the Export Contingent Values geoprocessing tool to export field groups and contingent values.

To export field groups and contingent values for a dataset, complete the following steps:

  1. Open the Contingent Values view for the dataset that contains the contingent values to export.

    The Contingent Values view opens for the dataset.

  2. On the Contingent Values tab, click the Export button in the Contingent Values group.

    The Export Contingent Values dialog box appears.

  3. For Field Group CSV and Contingent Value CSV, provide a path and name for the .csv file, or click the browse button, browse to the folder where the .csv file will be stored, and provide a name for the .csv file.

    Two .csv files are created: one for the field group and one for the contingent values.

Import contingent values

You can use the Import button in the Contingent Values group on the Contingent Values tab or the Import Contingent Values geoprocessing tool to import field groups and contingent values.

To import field groups and contingent values for a dataset, complete the following steps:

  1. Open the Contingent Values view for the dataset that contains the contingent values to export.

    The Contingent Values view opens for the dataset.

  2. On the Contingent Values tab, click the Import button in the Contingent Values group.

    The Import Contingent Values dialog box appears.

  3. For Field Group CSV and Contingent Value CSV, provide a path and name for the corresponding .csv file, or click the browse button, browse to the folder where each of .csv file is stored, and click OK.

    The continent values appear in the Contingent Values view.

  4. Optionally, to replace the contingent values, check the Replace Values box.

    This option allows you to override existing values rather than merging changes with the existing contingent values in a dataset.

  5. Click the Save button Save on the Contingent Values tab.

    The contingent values are saved in the destination dataset.