Skip to main content

Import contingent values

You can use a .csv file to import contingent value combinations to existing field groups in a hosted feature layer or hosted table. This allows you to copy contingent values to a new layer that contains the same fields and corresponding domains.

Supported file format

The .csv file you use to import contingent value combinations must contain a specific set of fields and values.

In most cases, you will use a file that was created when you exported contingent values using one of the following workflows:

  • Exported from a hosted feature layer, view, or table

  • Exported from a geodatabase dataset using the Contingent Values view in ArcGIS Pro

  • Exported from a geodatabase dataset using the Export Contingent Values geoprocessing tool or ArcPy function

The files created from these workflows will be formatted as required to import the values to another hosted feature layer or table.

If you define your own .csv file to import contingent values, ensure that it includes all of the following fields with the appropriate attribute values.

Note:

A set of CV_TYPE<#>, CV_VALUE<#>, and DESCRIPTION<#> fields will exist for every contingent value combination defined for the field group. For example, if you are importing two sets of value combinations, your file will contain fields CV_TYPE1, CV_VALUE1, DESCRIPTION1, CV_TYPE2, CV_VALUE2, and DESCRIPTION2.

Field name

Description

Example value

CAV_ID

The ID of the contingent value. This must be an integer value that is unique across the values in this file.

1

IS_RETIRED

A string value—true or false—defining whether the contingent value is retired.

false

FIELD_GROUP

The name of the field group to which the contingent value corresponds. This field group must exist in the hosted feature layer or hosted table into which you import these values and must have the same name.

This is the field group name stored in the system database; it cannot contain spaces.

SchoolType

SUBTYPE

If the layer has a subtype and the subtype is used in the contingent value definition, this is the subtype code (integer) to which the rule is applied.

5

SUBTYPE_NAME

If the layer has a subtype and the subtype is used in the contingent value definition, this is the text description of the subtype code.

elementary

CV_TYPE\<#>

An integer indicating the type of contingent value. The integer values and their descriptions are as follows:

  • 1—Any

  • 2—Null

  • 3—Coded value

  • 4—Range

3

CV_VALUE\<#>

The specific field value.

If the CV_TYPE value is 1 (any) or 2 (null), the field value in the .csv file must be empty.

If the CV_TYPE value is 3 (coded value) or 4 (range), the field value specified in the .csv file must exist as a defined domain in the layer to which you are importing.

2

DESCRIPTION\<#>

If the contingent value type is a coded value, this is the text description of the coded value.

If the CV_TYPE value is 1 (any) or 2 (null), the description in the .csv file must be empty.

If the CV_TYPE value is 3 (coded value) or 4 (range), the description in the .csv file must exist as a defined domain description in the layer to which you are importing.

K through 5

Create field groups

The field groups that correspond to the contingent values to import must exist in the hosted feature layer or table before you can import contingent value combinations. Follow the instructions to create a field group.

Once the field groups exist, proceed with importing contingent values as described in the next section.

Import contingent value combinations

To import contingent value combinations from a .csv file, complete the following steps:

  1. Place the .csv file in a directory on the machine from which you will sign in to your ArcGIS Online organization.

    If you are using a file exported from a hosted feature layer or geodatabase dataset, extract the ContingentValues.csv file from the .zip file that was created from the export process, and place that .csv file on the local machine.

  2. Sign in to your ArcGIS Online organization.

    You must sign in as the owner of the hosted feature layer or hosted table to which you will import contingent values. Alternatively, you can sign in using an account that is assigned the default administrator role.

  3. Open the item page of the hosted feature layer or hosted table.

  4. Click the Data tab, and click Contingent values.

  5. Use the drop-down menu to select the layer or table to which you will import values.

  6. Ensure the correct value is selected from the Field group drop-down menu.

    Note:

    Only the contingent value combinations that correspond to the field group you choose from the Field group menu will be imported, even if the .csv file contains multiple field group names.

  7. If subtypes are defined for the layer that you selected in step 5, use the Subtype drop-down menu to choose the subtype to which the imported values apply.

    Note:

    Only the contingent value combinations that correspond to the subtype that you choose from the Subtype menu will be imported, even if the .csv file contains multiple subtypes.

  8. Click the Import button .

    The Import window appears.

  9. Drag the .csv file onto the Import window or click Select file and browse to the file and select it.

  10. Confirm which value combinations to import.

    Combinations must be unique; they cannot be duplicates of values already in the layer. The number of duplicate value combinations is listed at the bottom of the Import window; these values are not displayed in the review window, and they will not be imported.

    To exclude any value combinations, turn off the Include toggle button for that combination.

    To exclude multiple value combinations, check the box next to each one to exclude and turn off the Include selected toggle button at the top of the window.

  11. Click Save to import the values.

    The first 4,000 contingent value combinations for the field group and subtype that you specified are imported.

    Because 4,000 is the maximum number of value combinations you can import at one time, if the .csv file contains more than 4,000 contingent value combinations for the specified field group and subtype, repeat the steps above to import the next 4,000 contingent value combinations. Repeat the steps until all new contingent value combinations for the field group and subtype are imported.