Summary
Adds a contingent value to a field group on a feature class or table.
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})
Parameter | Explanation | Data 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.
| 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.
| Boolean |
Derived Output
Name | Explanation | Data Type |
out_table | The updated input with a contingent value added. | Table View; Raster Layer; Mosaic Layer |
Code sample
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