Exports field groups and contingent values to a .csv file.
This tool can be used in conjunction with the Import Contingent Values tool.
The field groups .csv file includes the NAME, IS_RESTRICTIVE, and FIELD columns. The FIELD column name will be incremented as needed to include all fields in the field group, for example, FIELD1, FIELD2, FIELD3, and so on.
The IS_RESTRICTIVE column is a field group property that has no meaning in the ArcGIS Pro 2.4 release but will be used in a future release.
Field groups .csv columns
Column Description Example
The field group name
Specifies whether the field group is restrictive
The name of the field
There will be as many CV_TYPE, CV_VALUE, and DESCRIPTION columns as needed to match the structure of the contingent value definition. These column names will be incremented as needed (for example, CV_TYPE1, CV_VALUE1, DESCRIPTION1, CV_TYPE2, CV_VALUE2, DESCRIPTION2 and so on) and will correspond to the order of the fields in the field groups .csv file. For example, CV_TYPE1, CV_VALUE1, and DESCRIPTION1 in the contingent values .csv file correspond with FIELD1 in the field groups .csv file.
Contingent values .csv columns
Column Description Example
The ID of the contingent value.
A Boolean value defining whether the contingent value is retired.
The name of the field group to which the contingent value corresponds.
If the dataset has a subtype and the subtype is used in the contingent value definition, this is the subtype code to which the rule is applied.
If the dataset has a subtype and the subtype is used in the contingent value definition, this is the text description of the subtype code.
The type of contingent value. The type value is stored as an integer as follows:
- 3—Coded Value
The specific field value. If the type is any or null, the value in the .csv file is empty.
If the contingent value type is a coded value, this is the text description of the coded value.
ExportContingentValues(target_table, field_groups_file, contingent_values_file)
The input geodatabase table or feature class from which the field groups and contingent values will be exported.
The location and name of the output .csv file that will be created with specific column names containing information about the field groups of the target table.
The location and name of the output .csv file that will be created with specific column names containing information about the contingent values of the target table.
Export the field groups and contingent values from a feature class named GasPipes.
import arcpy arcpy.ExportContingentValues_management("C:\\MyProject\\myConn.sde\\pro.USER1.Animals", "C:\\MyProject\\MyFieldGroups.csv", "C:\\MyProject\\MyContingentValues.csv")
- Basic: No
- Standard: Yes
- Advanced: Yes