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 |
|---|---|---|
|
|
The ID of the contingent value. This must be an integer value that is unique across the values in this file. |
1 |
|
|
A string value— |
false |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
An integer indicating the type of contingent value. The integer values and their descriptions are as follows:
|
3 |
|
|
The specific field value. If the If the |
2 |
|
|
If the contingent value type is a coded value, this is the text description of the coded value. If the If the |
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:
Place the
.csvfile 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.csvfile from the.zipfile that was created from the export process, and place that.csvfile on the local machine.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.
Open the item page of the hosted feature layer or hosted table.
Click the Data tab, and click Contingent values.
Use the drop-down menu to select the layer or table to which you will import values.
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
.csvfile contains multiple field group names.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
.csvfile contains multiple subtypes.Click the Import button
.The Import window appears.
Drag the
.csvfile onto the Import window or click Select file and browse to the file and select it.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.
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
.csvfile 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.