Create and manage 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.

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 on the previous page, 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 Fiberglass, Wood, and Steel types. 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

You must create a field group before creating contingent values across the fields of a feature class or table. 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:

  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 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 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. Before starting, ensure that any domains are applied to the fields at the subtype level in the Subtypes view.

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. Choose a field value from the drop-down menu for each field in the field group.

    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. 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. You can retire the value to keep it from being used in any more fields.

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, which 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. When 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

To import field groups and 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 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 .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.