- URL:
- https://<root>/<serviceName>/FeatureServer/<layerId>/contingentValues
- Methods:
GET- Version Introduced:
- 11.2
Description
The contingent resource returns the full contingent values definition for a feature layer. Contingent values describe valid combinations of field values based on field domains. They are supported at both the field and subtype level. Contingent attribute values extend the domain model by making the choice for a value on one field further constrain values that are placed on another field. The set of fields that are constrained by values in other fields make up a field group. To get the contingent values for more than one layer in one response, use the Query Contingent Values feature service operation. See the Create and manage contingent values help documentation for more information on contingent values.
New at 12.2
- The
idandSubset fieldparameters have been added at this release and allows users to filter the results returned by this resource. You can filter by a subset of contingent value IDs and a subset of field groups, respectively.Group Subset - A new operation, Export, has been added under Contingent Values. The
exportoperation also accepts theidandSubset fieldparameters, allowing you to filter what contingent values are exported. TheGroup Subset exportoperation supports csv, json, and pbf export formats. Exporting to a csv format produces a .zip file that contains three output files (ContingentValues.csv, FieldGroups.csv and schema.ini), which are compatible with the ArcGIS Pro Export Contingent Values and Import Contingent Values tools.
Request parameters
| Parameter | Details |
|---|---|
| Introduced at ArcGIS Enterprise 12.2. Filters the response by providing a comma-separated list or range of contingent value IDs. |
| Introduced at ArcGIS Enterprise 12.2. Filters the response by providing a comma-separated list of field group names. If not included in the request, or if left empty, all field groups are returned. |
| The response format. The default format is Values: |
Example usage
The following is a sample request URL used to access the contingent resource, filtering results using the field and id parameters:
https://organization.example.com/<context>/rest/services/Hosted/CV_SimpleSubtype/FeatureServer/0/contingentValues?idSubset=1-3&fieldGroupSubset=make_rating&f=pjsonJSON Response examples
The following is a sample JSON response returned by the contingent resource:
{
"typeCodes": [
"Unknown",
"Any",
"Null",
"Code",
"Range"
],
"stringDicts": [
{
"entries": [
"Excellent",
"Good",
"OK",
"HasIssues"
],
"domain": "drating"
}
],
"contingentValuesDefinition": {
"fieldGroups": [
{
"name": "make_rating",
"restrictive": true,
"subTypes": [
{
"code": 100,
"name": "Airplane",
"domains": {
"vmake": "dmakes",
"vrating": "drating"
},
"contingentValues": [
{
"types": [
3,
3
],
"values": [
3,
1
],
"id": 1
},
{
"types": [
3,
3
],
"values": [
4,
1
],
"id": 2
},
{
"types": [
3,
1
],
"values": [7],
"id": 3
},
{
"types": [
3,
3
],
"values": [
8,
1
],
"id": 4
},
{
"types": [
3,
3
],
"values": [
10,
0
],
"id": 5
},
{
"types": [
3,
3
],
"values": [
3,
3
],
"id": 6
},
{
"types": [
3,
3
],
"values": [
3,
2
],
"id": 7
},
{
"types": [
3,
3
],
"values": [
4,
0
],
"id": 8
},
{
"types": [
3,
3
],
"values": [
8,
0
],
"id": 9
},
{
"types": [
3,
3
],
"values": [
10,
1
],
"id": 10
}
]
},
{
"code": 200,
"name": "Automobile",
"domains": {
"vmake": "dmakes",
"vrating": "drating"
},
"contingentValues": [
{
"types": [
3,
3
],
"values": [
1,
0
],
"id": 11
},
{
"types": [
3,
3
],
"values": [
1,
1
],
"id": 12
},
{
"types": [
3,
3
],
"values": [
1,
2
],
"id": 13
},
{
"types": [
3,
3
],
"values": [
2,
1
],
"id": 14
},
{
"types": [
3,
3
],
"values": [
2,
2
],
"id": 15
},
{
"types": [
3,
1
],
"values": [5],
"id": 16
},
{
"types": [
3,
3
],
"values": [
6,
0
],
"id": 17
},
{
"types": [
3,
3
],
"values": [
6,
1
],
"id": 18
},
{
"types": [
3,
3
],
"values": [
6,
2
],
"id": 19
},
{
"types": [
3,
3
],
"values": [
10,
0
],
"id": 20
},
{
"types": [
3,
3
],
"values": [
10,
2
],
"id": 21
},
{
"types": [
3,
1
],
"values": [9],
"id": 51
}
]
}
],
"fields": [
{
"name": "vmake",
"id": 0,
"fieldType": "esriFieldTypeInteger"
},
{
"name": "vrating",
"id": 1,
"fieldType": "esriFieldTypeString"
}
]
},
{
"name": "make_model2",
"restrictive": true,
"subTypes": [
{
"code": 100,
"name": "Airplane",
"domains": {
"vmake": "dmakes",
"vmodel": "dmodels"
},
"contingentValues": [
{
"types": [
3,
3
],
"values": [
3,
5
],
"id": 22
},
{
"types": [
3,
3
],
"values": [
3,
6
],
"id": 23
},
{
"types": [
3,
3
],
"values": [
4,
7
],
"id": 26
},
{
"types": [
3,
3
],
"values": [
4,
8
],
"id": 27
},
{
"types": [
3,
3
],
"values": [
7,
14
],
"id": 30
},
{
"types": [
3,
3
],
"values": [
7,
15
],
"id": 31
},
{
"types": [
3,
3
],
"values": [
7,
16
],
"id": 32
},
{
"types": [
3,
3
],
"values": [
8,
12
],
"id": 33
},
{
"types": [
3,
3
],
"values": [
8,
13
],
"id": 34
},
{
"types": [
3,
3
],
"values": [
10,
28
],
"id": 35
},
{
"types": [
3,
3
],
"values": [
10,
29
],
"id": 36
}
]
},
{
"code": 200,
"name": "Automobile",
"domains": {
"vmake": "dmakes",
"vmodel": "dmodels"
},
"contingentValues": [
{
"types": [
3,
3
],
"values": [
1,
1
],
"id": 24
},
{
"types": [
3,
3
],
"values": [
1,
2
],
"id": 25
},
{
"types": [
3,
3
],
"values": [
2,
3
],
"id": 28
},
{
"types": [
3,
3
],
"values": [
2,
4
],
"id": 29
},
{
"types": [
3,
3
],
"values": [
5,
9
],
"id": 37
},
{
"types": [
3,
3
],
"values": [
5,
10
],
"id": 38
},
{
"types": [
3,
3
],
"values": [
5,
11
],
"id": 39
},
{
"types": [
3,
3
],
"values": [
6,
21
],
"id": 40
},
{
"types": [
3,
3
],
"values": [
6,
24
],
"id": 41
},
{
"types": [
3,
3
],
"values": [
6,
22
],
"id": 42
},
{
"types": [
3,
3
],
"values": [
6,
25
],
"id": 43
},
{
"types": [
3,
3
],
"values": [
9,
17
],
"id": 44
},
{
"types": [
3,
3
],
"values": [
9,
18
],
"id": 45
},
{
"types": [
3,
3
],
"values": [
9,
19
],
"id": 46
},
{
"types": [
3,
3
],
"values": [
9,
20
],
"id": 47
},
{
"types": [
3,
3
],
"values": [
10,
26
],
"id": 48
},
{
"types": [
3,
3
],
"values": [
10,
27
],
"id": 49
},
{
"types": [
3,
3
],
"values": [
6,
23
],
"id": 50
}
]
}
],
"fields": [
{
"name": "vmake",
"id": 0,
"fieldType": "esriFieldTypeInteger"
},
{
"name": "vmodel",
"id": 1,
"fieldType": "esriFieldTypeInteger"
}
]
}
],
"layerID": 0,
"hasSubType": true,
"layerName": "CV_Table",
"geometryType": "esriGeometryPoint"
}
}The sample JSON response below represents a filtered contingent response:
{
"typeCodes": [
"Unknown",
"Any",
"Null",
"Code",
"Range"
],
"stringDicts": [
{
"entries": ["Good"],
"domain": "drating"
}
],
"contingentValuesDefinition": {
"fieldGroups": [
{
"name": "make_rating",
"restrictive": true,
"subTypes": [
{
"code": 100,
"name": "Airplane",
"domains": {
"vmake": "dmakes",
"vrating": "drating"
},
"contingentValues": [
{
"types": [3,3],
"values": [3,0],
"id": 1
},
{
"types": [3,3],
"values": [4,0],
"id": 2
},
{
"types": [3,1],
"values": [7],
"id": 3
}
]
}
],
"fields": [
{
"name": "vmake",
"id": 0,
"fieldType": "esriFieldTypeInteger"
},
{
"name": "vrating",
"id": 1,
"fieldType": "esriFieldTypeString"
}
]
}
],
"layerID": 0,
"hasSubType": true,
"layerName": "CV_Table",
"geometryType": "esriGeometryPoint"
}
}