Add Contingent Value (Data Management)

Summary

Adds a contingent value to a field group on a feature class or table.

Learn more about contingent values

Usage

  • The dataset must have one or more field groups created before a contingent value can be added. The Create Field Group tool can be used to create a field group.

  • If the input feature class or table has subtypes and you want to add the contingent value to more than one subtype, you need to run this tool once for each subtype. You cannot add to all subtypes at once.

  • If your data is stored in an enterprise geodatabase, you must be connected as the data owner to use this tool.

  • Contingent values are compatible with ArcGIS Pro 2.3 and later geodatabases. If the geodatabase is an earlier version, upgrade it to work with contingent values.

  • Once a field group is added to a dataset, the dataset version is set to ArcGIS Pro 2.3. This means that the dataset can no longer be used in ArcMap.

Parameters

LabelExplanationData Type
Target Table

The input geodatabase feature class or table to which the contingent value will be added.

Table View
Field Group Name

The field group to which the contingent value will be added.

String
Values

The field name, field value type, and associated field values that will be used for the new contingent value.

  • Field Name—The name of the field that participates in the field group.
  • Field Value Type—The type of contingent value. The Any and Null types will ignore any value specified in the Field Value field.
    • Any—The value can be any field value.
    • Null—The value is null.
    • Coded Value—The value is from a coded value domain.
    • Range—The value is a minimum/maximum subset of a range domain.
  • Field Value—The specific field value. If Field Value Type is Coded Value, specify the code. If Field Value Type is Range, specify the minimum and maximum values in the format min;max (for example, 10;100).

Value Table
Subtype
(Optional)

The input table subtype to which the contingent value will be added.

String
Retire Value
(Optional)

Specifies whether the contingent value will be retired. The contingent value is considered retired when it is no longer created but can still be used in an existing field. When a contingent value is retired, it will still be shown in the list of valid values for a field, such as in the Attribute pane. An example is using asbestos as a building material. New construction cannot use asbestos as a building material, but existing structures may still have this attribute. For more information about retired values, see Create and manage contingent values.

  • Checked—The contingent value will be retired.
  • Unchecked—The contingent value will not be retired. This is the default.

Boolean

Derived Output

LabelExplanationData Type
Output Feature Class

The updated input with a contingent value added.

Table View; Raster Layer; Mosaic Layer

arcpy.management.AddContingentValue(target_table, field_group_name, values, {subtype}, {retire_value})
NameExplanationData Type
target_table

The input geodatabase feature class or table to which the contingent value will be added.

Table View
field_group_name

The field group to which the contingent value will be added.

String
values
[[Field Name, Field Value Type, Field Value],...]

The field name, field value type, and associated field values that will be used for the new contingent value.

  • Field name—The name of the field that participates in the field group.
  • Field value type—The type of contingent value. The ANY and NULL types will ignore any value specified in the field value field.
    • ANY—The value can be any field value.
    • NULL—The value is null.
    • CODED_VALUE—The value is from a coded value domain.
    • RANGE—The value is a minimum/maximum subset of a range domain.
  • Field value—The specific field value. If the field value type is CODED_VALUE, specify the code. If the field value type is RANGE, specify the minimum and maximum values in the format min;max (for example, 10;100).

Value Table
subtype
(Optional)

The input table subtype to which the contingent value will be added.

String
retire_value
(Optional)

Specifies whether the contingent value will be retired. The contingent value is considered retired when it is no longer created but can still be used in an existing field. When a contingent value is retired, it will still be shown in the list of valid values for a field, such as in the Attribute pane. An example is using asbestos as a building material. New construction cannot use asbestos as a building material, but existing structures may still have this attribute. For more information about retired values, see Create and manage contingent values.

  • RETIREThe contingent value will be retired.
  • DO_NOT_RETIREThe contingent value will not be retired. This is the default.
Boolean

Derived Output

NameExplanationData Type
out_table

The updated input with a contingent value added.

Table View; Raster Layer; Mosaic Layer

Code sample

AddContingentValue example (Python window)

Add a new contingent value that has a coded value domain assigned to the field.

import arcpy
CV = [["FieldName1", "CODED_VALUE", "DomainValue1"], 
      ["FieldName2", "CODED_VALUE", "DomainValue2"]]
arcpy.management.AddContingentValue("C:\\MyProject\\myConn.sde\\mygdb.USER1.myFC", 
                                    "MyFieldGroup", CV, "My Subtype", 
                                    "DO_NOT_RETIRE")

Environments

Related topics