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, this tool will need to be executed once for each subtype. There is no option to 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 your geodatabase is an earlier version, upgrade your geodatabase 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.

Syntax

arcpy.management.AddContingentValue(target_table, field_group_name, values, {subtype}, {retire_value})
ParameterExplanationData 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 to be used for the new contingent attribute 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 parameter.
    • 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 min/max subset of a range domain.
  • Field Value—The specific field value. If the Field Value Type is CODED_VALUE, specify the code description. 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, but it will be disabled and you won't be able to select it as a field value. 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.

  • 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.AddContingentValue_management("C:\\MyProject\\myConn.sde\\mygdb.USER1.myFC", 
                                    "MyFieldGroup",	CV, "My Subtype", 
                                    "DO_NOT_RETIRE")

Environments

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics