Query Domains (Feature Service)

Description

This operation was added at 10.5. Services that support the queryDomains operation include the supportsQueryDomains property set to true in the service resource.

The queryDomains operation returns full domain information for the domains referenced by the layers in the service. This operation is performed on a feature service resource. The operation takes an array of layer IDs and returns the set of domains referenced by the layers.

This operation can be used by clients to efficiently work with domains. For example, a client can use the queryDomains operation to get and cache domain information once. When getting layer information from the layer resource, clients can then use the returnDomainNames=true parameter to get just the domain names in the layer resource. The domain names can then be used to find the full domain information in the cache.

Request Parameters

Parameter

Details

f

Description: The response format. The default response format is html.

Values: html | json

layers

Description: An array of layers.

The set of domains to return is based on the domains referenced by these layers.

Syntax:

[<layerId1>,<layerId2>]

Example:

[0,1,2,3,4,5,6]

Example Usage

JSON Response Syntax

{
 "domains": [
  {
   "type": "<domainType>",
   "name": "<domainName>",
   "fieldType": "<esriFieldType>",
   "range": [
    <minValue>,
    <maxValue>
   ],
   "mergePolicy": "<mergePolicy>",
   "splitPolicy": "<splitPolicy>"
  },
  {
   "type": "<domainType>",
   "name": "<domainName2>",
   "fieldType": "<esriFieldType>",
   "codedValues": [
    {
     "name": "<codedValueDescription1>",
     "code": <codedValue1>
    },
    {
     "name": "<codedValueDescription2>",
     "code": <codedValue2>
    },
   ],
   "mergePolicy": "<mergePolicy>",
   "splitPolicy": "<splitPolicy>"
  }
 ]
}

JSON Response Example

{
 "domains": [
  {
   "type": "range",
   "name": "RDOM_1",
   "fieldType": "esriFieldTypeInteger",
   "range": [
    1,
    50
   ],
   "mergePolicy": "esriMPTDefaultValue",
   "splitPolicy": "esriSPTDefaultValue"
  },
  {
   "type": "range",
   "name": "RDOM_3",
   "fieldType": "esriFieldTypeDouble",
   "range": [
    100,
    150.5
   ],
   "mergePolicy": "esriMPTDefaultValue",
   "splitPolicy": "esriSPTDefaultValue"
  },
  {
   "type": "codedValue",
   "name": "CDOM_1",
   "fieldType": "esriFieldTypeDouble",
   "codedValues": [
    {
     "name": "code 1 description",
     "code": 1
    },
    {
     "name": "code 1.5 description",
     "code": 1.5
    },
    {
     "name": "code 2 description",
     "code": 2
    },
    {
     "name": "code 2.5 description",
     "code": 2.5
    }
   ],
   "mergePolicy": "esriMPTDefaultValue",
   "splitPolicy": "esriSPTDefaultValue"
  },
  {
   "type": "codedValue",
   "name": "CDOM_3",
   "fieldType": "esriFieldTypeInteger",
   "codedValues": [
    {
     "name": "code 100 description",
     "code": "code 100"
    },
    {
     "name": "code 200 description",
     "code": "code 200"
    },
    {
     "name": "code 300 description",
     "code": "code 300"
    }
   ],
   "mergePolicy": "esriMPTDefaultValue",
   "splitPolicy": "esriSPTDefaultValue"
  },
  {
   "type": "codedValue",
   "name": "CDOM_4",
   "fieldType": "esriFieldTypeDouble",
   "codedValues": [
    {
     "name": "coded 1000.1 desc",
     "code": 1000.1
    },
    {
     "name": "coded 2000.1 desc",
     "code": 2000.2
    },
    {
     "name": "coded 3000.1 desc",
     "code": 3000.3000000000002
    }
   ],
   "mergePolicy": "esriMPTDefaultValue",
   "splitPolicy": "esriSPTDefaultValue"
  }
 ]
}

7/27/2017