- URL:
- https://<gpservice-url>/<taskName>
- Methods:
GETPOST- Operations:
- Execute Task, Submit Job
- Child Resources:
- Job
- Version Introduced:
- 9.3
Description
A geoprocessing task resource represents a single task in a geoprocessing service published to ArcGIS Server. It provides the task name, display name, and detailed information about various input and output parameters.
A geoprocessing task resource supports the following operations:
submit—For tasks with an asynchronous operation type. An asynchronous type means that the application does not wait for the task to complete, and the end user can continue using the application. A client must actively check the status of the job to learn its progress and results when finished.Job execute—For tasks with a synchronous operation type. A synchronous type means that the application waits while the tool runs on the server. Because the end user must wait, determine whether the wait time is acceptable for the type of application. Fast running analysis is a common use case for synchronous type. However, an output feature service is not available.validate—For tasks with validate capability, introduced at ArcGIS Enterprise 12.0. Validate operation acts like a synchronous geoprocessing service to response with updated task information based on provided input.
Child resources
At 10.9.1, the new metadata child resource is available. It shows the metadata for a geoprocessing task resource in XML format only. No request parameter is needed. An example usage is to access the metadata using the following URL:
Getting the metadata for the My task.
https://organization.example.com/<context>/rest/services/myServiceName/GPServer/MyTaskName/metadata.
Request parameter
| Parameter | Details |
|---|---|
(Optional) | The response format. The default response format is Values: |
Example usage
Example 1: Request URL for the Create task for ESRI.
This request will return the HTML page of the GPTask.
https://organization.example.com/<context>/rest/services/Network/ESRI_DriveTime_US/GPServer/CreateDriveTimePolygonsExample 2: Request URL for the 911 call hot spot analysis with a JSON return format:
This request will return the GPTask with JSON.
https://organization.example.com/<context>/rest/services/911CallsHotspot/GPServer/911%20Calls%20Hotspot?f=jsonJSON Response schema
The JSON schema shown below is for a geoprocessing task response when queried with JSON. The parameter property is available starting at ArcGIS Server 11.0. The GPValueTable, GPMultiValue, and GPComposite data types are subject to the availability of that data type in your ArcGIS Server version.
Starting at ArcGIS Enterprise 12.2, additional numeric and unit domain information is available for geoprocessing services published from ArcGIS Pro 3.8. This information is represented by the long, double, linear, areal, time, unit, and boolean filter types described in the Filters section. All filters are available for GP columns and they will be in the composite filter.
JSON Schema for a GPTask
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "JSON Schema for GP Task endpoint",
"description": "This schema describes the JSON return of a GP Task endpoint. Depending on the version of ArcGIS Server and the original tool, optional keys may not be present.",
"type": "object",
"properties": {
"name": { "type": "string" },
"displayName": { "type": "string" },
"description": { "type": "string" },
"category": { "type": "string" },
"helpUrl": { "type": "string", "format": "uri" },
"executionType": { "type": "string" },
"parameters": {
"type": "array",
"description": "List of parameters for the GP Task",
"items": {
"description": "Individual parameter",
"type": "object",
"required": [
"name",
"dataType",
"displayName",
"description",
"direction",
"defaultValue",
"parameterType",
"category"
],
"properties": {
"name": {
"description": "The name of the parameter",
"type": "string"
},
"dataType": {
"description": "The data type of the parameter",
"type": "string"
},
"displayName": {
"description": "The display name of the parameter",
"type": "string"
},
"description": {
"description": "The description of the parameter",
"type": "string"
},
"direction": {
"description": "Whether it is an input or an output parameter",
"type": "string",
"enum": [
"esriGPParameterDirectionInput",
"esriGPParameterDirectionOutput"
]
},
"dependency": {
"description": "The parameter this one depends on",
"type": "string"
},
"defaultValue": {
"description": "The default value of the parameter. The type depends on the possible values of the parameter. It can be null."
},
"parameterType": {
"description": "Whether it is a required or an optional parameter",
"type": "string",
"enum": [
"esriGPParameterTypeRequired",
"esriGPParameterTypeOptional",
"esriGPParameterTypeDerived"
]
},
"category": {
"description": "The category of the parameter",
"type": "string"
},
"choiceList": {
"$ref": "#/$defs/choiceList"
},
"filter": {
"$ref": "#/$defs/filter"
},
"parameterInfos": {
"description": "Information for GPMultiValue, GPValueTable, and GPComposite",
"type": "array",
"items": {
"description": "An individual element of the data type",
"type": "object",
"required": ["dataType"],
"properties": {
"name": {
"description": "The name of a column for GPValueTable, empty value for GPMultivalue and GPComposite",
"type": "string"
},
"dataType": {
"description": "The data type of the element",
"type": "string"
},
"parameterInfos": {
"description": "This parameter info is only possible for a GPMultiValue:GPComposite",
"type": "array",
"items": {
"description": "Possible types for a GPComposite",
"type": "object",
"required": ["dataType"],
"properties": {
"name": {
"description": "This will be an empty string",
"type": "string"
},
"dataType": {
"description": "The data type of an allowed value",
"type": "string"
},
"displayName": {
"description": "This will be an empty string.",
"type": "string"
}
}
}
},
"displayName": {
"description": "The name of a column for GPValueTable, empty value for GPMultivalue and GPComposite",
"type": "string"
},
"filter": {
"$ref": "#/$defs/filter"
},
"choiceList": {
"$ref": "#/$defs/choiceList"
}
}
}
}
}
}
}
},
"$defs": {
"filter": {
"description": "For an input with a filter. For better readability, see individual filter type schema at the end of this page.",
"type": "object",
"required": ["type"],
"properties": {
"type": {
"description": "The type of filter",
"type": "string",
"enum": [
"range",
"featureClass",
"file",
"field",
"codedValue",
"composite",
"long",
"double",
"linearUnit",
"arealUnit",
"timeUnit",
"unit",
"boolean"
]
},
"minimum": {
"description": "The lower end of a range filter",
"type": "number"
},
"maximum": {
"description": "The upper end of a range filter",
"type": "number"
},
"list": {
"description": "Allowed values or nested filters. The item type depends on the filter type.",
"type": "array",
"items": {}
},
"valueInfo": {
"$ref": "#/$defs/filter",
"description": "Value filter component. Typically a range filter."
},
"valueInfoLinearUnit": {
"description": "The linear unit that qualifies the valueInfo range.",
"type": "string"
},
"valueInfoArealUnit": {
"description": "The areal unit that qualifies the valueInfo range.",
"type": "string"
},
"valueInfoTimeUnit": {
"description": "The time unit that qualifies the valueInfo range.",
"type": "string"
},
"unitInfo": {
"$ref": "#/$defs/filter",
"description": "Value filter component. Typically a linearUnit, arealUnit, or a timeUnit filter."
},
"trueDisplayName": {
"description": "The display name for a true value in a boolean filter.",
"type": "string"
},
"falseDisplayName": {
"description": "The display name for a false value in a boolean filter.",
"type": "string"
}
}
},
"choiceList": {
"description": "For input with a choice list, or a ValueList filter",
"type": "array",
"items": {
"description": "Individual choice on the list",
"type": "string"
},
"uniqueItems": true
}
},
"required": [
"name",
"displayName",
"description",
"category",
"helpUrl",
"executionType",
"parameters"
],
"additionalProperties": false
}JSON Response example 1
A sample asynchronous geoprocessing task with an input feature parameter with a filter, an output feature parameter, and an automatically added optional input parameter.
{
"name": "FeatureFiltersLinePolygon",
"displayName": "Feature filters with line and polygon",
"description": "This is a feature analysis with input polyline and polygon only. Points are not supported.",
"category": "",
"helpUrl": "https://organization.example.com/<context>/rest/directories/arcgisoutput/Level2_Features_Async_GPServer/Level2_Features_Async/FeatureFiltersLinePolygon.htm",
"executionType": "esriExecutionTypeAsynchronous",
"parameters": [
{
"name": "Input_Features",
"dataType": "GPFeatureRecordSetLayer",
"displayName": "Input Features",
"description": "line and polygon only",
"direction": "esriGPParameterDirectionInput",
"filter": {
"type": "featureClass",
"list": [
"esriGeometryPolygon",
"esriGeometryPolyline"
]
},
"defaultValue": {
"displayFieldName": "",
"hasZ": true,
"geometryType": "esriGeometryPolygon",
"spatialReference": {
"wkid": 102100,
"latestWkid": 3857
},
"fields": [
{
"name": "OBJECTID",
"type": "esriFieldTypeOID",
"alias": "OBJECTID"
},
{
"name": "countshort",
"type": "esriFieldTypeSmallInteger",
"alias": "countshort"
},
{
"name": "geom",
"type": "esriFieldTypeSingle",
"alias": "geom"
},
{
"name": "Shape_Length",
"type": "esriFieldTypeDouble",
"alias": "Shape_Length"
},
{
"name": "Shape_Area",
"type": "esriFieldTypeDouble",
"alias": "Shape_Area"
}
],
"features": [],
"exceededTransferLimit": false
},
"parameterType": "esriGPParameterTypeRequired",
"category": ""
},
{
"name": "Output_Feature_Class",
"dataType": "GPFeatureRecordSetLayer",
"displayName": "Output Feature Class",
"description": "ofc",
"direction": "esriGPParameterDirectionOutput",
"defaultValue": {
"displayFieldName": "",
"hasZ": true,
"geometryType": "esriGeometryPoint",
"spatialReference": {
"wkid": 102100,
"latestWkid": 3857
},
"fields": [
{
"name": "OBJECTID",
"type": "esriFieldTypeOID",
"alias": "OBJECTID"
},
{
"name": "countshort",
"type": "esriFieldTypeSmallInteger",
"alias": "countshort"
},
{
"name": "geom",
"type": "esriFieldTypeSingle",
"alias": "geom"
},
{
"name": "ORIG_FID",
"type": "esriFieldTypeInteger",
"alias": "ORIG_FID"
}
],
"features": [],
"exceededTransferLimit": false
},
"parameterType": "esriGPParameterTypeRequired",
"category": ""
},
{
"name": "esri_out_feature_service_name",
"dataType": "GPString",
"displayName": "Output Feature Service Name",
"description": "The name of the optional feature service to create on the federated server containing the result of this tool. If no name is specified, an output feature service will not be created.",
"direction": "esriGPParameterDirectionInput",
"defaultValue": "",
"parameterType": "esriGPParameterTypeOptional",
"category": ""
}
]
}JSON Response example 2
A sample synchronous geoprocessing task with the GP parameter, including columns with filters and a GPMultiValue:GPRasterDataLayer output parameter.
{
"name": "filters",
"displayName": "Input value table with range filters",
"description": "This analysis will take a GPValueTable with two columns as an input and generate a multivalue of raster layers as an output",
"category": "",
"helpUrl": "https://organization.example.com/<context>/rest/directories/arcgisoutput/Level2_ValueTable_Sync_GPServer/Level2_ValueTable_Sync/filters.htm",
"executionType": "esriExecutionTypeSynchronous",
"parameters": [
{
"name": "Input_range_filters",
"dataType": "GPValueTable",
"displayName": "Input range filters",
"description": "long and double are the columns. first column long has a range of -99,999 to 99,999 second column double has a range of -12345678.9 to 98765.4321",
"direction": "esriGPParameterDirectionInput",
"defaultValue": [
[
567,
-56756.567
],
[
-6567,
67886.678
]
],
"parameterType": "esriGPParameterTypeRequired",
"category": "",
"parameterInfos": [
{
"name": "input long column",
"dataType": "GPLong",
"displayName": "input long column",
"filter": {
"type": "range",
"minimum": -99999,
"maximum": 99999
}
},
{
"name": "input double column",
"dataType": "GPDouble",
"displayName": "input double column",
"filter": {
"type": "range",
"minimum": -1.23456789E7,
"maximum": 98765.4321
}
}
]
},
{
"name": "Output_raster_layers",
"dataType": "GPMultiValue:GPRasterDataLayer",
"displayName": "Output raster layers",
"description": "",
"direction": "esriGPParameterDirectionOutput",
"defaultValue": [],
"parameterType": "esriGPParameterTypeDerived",
"category": "",
"parameterInfos": [
{
"name": "",
"dataType": "GPRasterDataLayer",
"displayName": ""
}
]
}
]
}Filters
A filter can effectively enforce any rules a tool author wants to impose on an input parameter to ensure only supported values by the tool can be provided when a user is using a geoprocessing service. Many existing analysis tools have built-in filters defined. If you want to design your own filters, use the Filter class in arcpy.
The coded and composite filters were introduced at ArcGIS Enterprise 12.0.
Starting at ArcGIS Enterprise 12.2, geoprocessing services published from ArcGIS Pro 3.8 can expose numeric coded-value domains, unit coded-value domains, unit range domains, and Boolean display names through the long, double, linear, areal, time, unit, and boolean filter types. Unit filters can also be nested in a composite filter for GP columns. Existing choice values remain available for backward compatibility.
Clients can use this information to present supported options for inputs and validate parameter values before submit or execute a task.
Feature Class
The feature class filter is available for GPFeatureRecordSetLayer. This filter allows you to restrict the types of features your geoprocessing service user can provide.
JSON Schema
The schema shows a shortened version of the parameter of your GP to highlight the filter with a feature type.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "JSON Schema for Feature Class Filter",
"description": "Schema defining a filter for ArcPy parameters that accept only certain feature class geometry types.",
"type": "object",
"properties": {
"filter": {
"description": "Filter definition object.",
"type": "object",
"properties": {
"type": {
"description": "The type of filter.",
"type": "string",
"enum": ["featureClass"]
},
"list": {
"description": "List of allowed feature class geometry types.",
"type": "array",
"items": {
"type": "string",
"enum": [
"esriGeometryPoint",
"esriGeometryMultipoint",
"esriGeometryPolyline",
"esriGeometryPolygon",
"esriGeometryMultiPatch",
"esriGeometryEnvelope"
]
},
"minItems": 1,
"uniqueItems": true
}
},
"required": ["type", "list"],
"additionalProperties": false
}
},
"required": ["filter"],
"additionalProperties": false
}JSON Example
In this code snippet example, only polygons and polylines are allowed.
{
"filter": {
"type": "featureClass",
"list": ["esriGeometryPolyline","esriGeometryPolygon"]
}
}Range
The range filter is available for GPLong and GPDouble where you can specify the range for your input.
JSON Schema
The schema shows a shortened version of the parameter of your GP to highlight the filter with a range type.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "JSON Schema for ArcGIS Range Filter",
"description": "Schema defining a filter object with type 'range' and numeric minimum/maximum values.",
"type": "object",
"properties": {
"filter": {
"description": "Filter definition object.",
"type": "object",
"properties": {
"type": {
"description": "The type of filter.",
"type": "string",
"enum": ["range"]
},
"minimum": {
"description": "The lower end of a range filter.",
"type": "number"
},
"maximum": {
"description": "The upper end of a range filter.",
"type": "number"
}
},
"required": ["type", "minimum", "maximum"],
"additionalProperties": false
}
},
"required": ["filter"],
"additionalProperties": false
}JSON Example
{
"filter": {
"type": "range",
"minimum": -9999,
"maximum": 9999
}
}Numeric coded-value domains
A GP or GP input parameter with an authored choice list exposes the choices through a numeric filter. The long filter serializes each choice as a JSON integer, and the double filter serializes each choice as a JSON number. Positive and negative values are preserved. A value that is not included in the filter's list is invalid.
The existing choice property continues to be returned for compatibility and contains string values. The parameter's default continues to use the native JSON numeric type.
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "JSON Schema for Numeric Coded-Value Filters",
"description": "Schema defining GPLong and GPDouble coded-value filters.",
"type": "object",
"properties": {
"filter": {
"type": "object",
"properties": {
"type": {
"enum": ["long", "double"]
},
"list": {
"type": "array"
}
}
}
}
}JSON Examples
A GP filter uses JSON integers:
{
"filter": {
"type": "long",
"list": [
123,
-123
]
}
}A GP filter uses JSON numbers:
{
"filter": {
"type": "double",
"list": [
123.456,
-987.654
]
}
}Unit coded-value domains
An authored choice list for a GPLinearUnit, GPArealUnit, or GPTimeUnit input parameter is represented by a linear, areal, or time filter, respectively. The filter's list contains REST unit enumeration values rather than the display values in choice. A unit that is not included in the filter's list is invalid. Unlike other data type having choice in the parameters, you still need to provide the object of the linear, areal, or time when submitting or executing a task, not just the unit enumeration value.
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "JSON Schema for Unit Coded-Value Filters",
"description": "Schema defining coded-value filters for linear, areal, and time units.",
"type": "object",
"properties": {
"filter": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": ["linearUnit", "arealUnit", "timeUnit"]
},
"list": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": ["type", "list"]
}
},
"required": ["filter"]
}JSON Example
The following linear filter allows four linear units. The same structure applies to areal and time filters using the corresponding REST unit enumeration values.
{
"filter": {
"type": "linearUnit",
"list": [
"esriMiles",
"esriIntMiles",
"esriMeters",
"esriKilometers"
]
}
}Unit range domains
A unit parameter with numeric range validation exposes a unit filter. The value object defines the inclusive numeric range. One of value, value, or value identifies the unit that qualifies the range. The optional unit object identifies the unit category and can restrict the allowed units through its list.
Values below minimum or above maximum are invalid. When unit is present, a unit not included in the list is invalid. You can only author a unit range domain enforcing a range and a selection of units in a Python toolbox by specifying the selection of units first, then the range.
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": ["filter"],
"properties": {
"filter": {
"type": "object",
"required": ["type", "valueInfo"],
"properties": {
"type": { "const": "unit" },
"unitInfo": { "$ref": "#/$defs/unitInfo" },
"valueInfo": { "$ref": "#/$defs/range" },
"valueInfoLinearUnit": { "type": "string" },
"valueInfoArealUnit": { "type": "string" },
"valueInfoTimeUnit": { "type": "string" }
}
}
},
"$defs": {
"range": {
"type": "object",
"required": ["type", "minimum", "maximum"],
"properties": {
"type": { "const": "range" },
"minimum": { "type": "number" },
"maximum": { "type": "number" }
}
},
"unitInfo": {
"type": "object",
"required": ["type"],
"properties": {
"type": { "enum": ["linearUnit", "arealUnit", "timeUnit"] },
"list": { "type": "array", "items": { "type": "string" }, "minItems": 1, "uniqueItems": true }
}
}
}
}JSON Examples
A GP filter can specify both a range and a restricted list of linear units. In this example, anything between 1 and 999 meters is valid, and only miles and meters are allowed. If a user provides a value using the miles, it will be converted automatically to meters for the range validation.
{
"filter": {
"type": "unit",
"valueInfoLinearUnit": "esriMeters",
"valueInfo": {
"type": "range",
"minimum": 1,
"maximum": 999
},
"unitInfo": {
"type": "linearUnit",
"list": [
"esriMiles",
"esriMeters"
]
}
}
}A GP range is qualified by value:
{
"filter": {
"type": "unit",
"valueInfoArealUnit": "esriSquareMeters",
"valueInfo": {
"type": "range",
"minimum": 1,
"maximum": 9999
}
}
}A GP range is qualified by value:
{
"filter": {
"type": "unit",
"valueInfoTimeUnit": "esriTimeUnitsSeconds",
"valueInfo": {
"type": "range",
"minimum": 1,
"maximum": 59
}
}
}Boolean domains
A boolean filter can provide alternative display names for the true and false values of a GP parameter, if there is an existing tool from ArcGIS Pro that has authored display names for the true and false values.
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "JSON Schema for Boolean Filters",
"description": "Schema defining alternative display names for a GPBoolean parameter.",
"type": "object",
"properties": {
"filter": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "boolean"
},
"trueDisplayName": {
"type": "string"
},
"falseDisplayName": {
"type": "string"
}
},
"required": ["type", "trueDisplayName", "falseDisplayName"]
}
}
}JSON Example
{
"filter": {
"type": "boolean",
"trueDisplayName": "My Positive",
"falseDisplayName": "My Negative"
}
}Field
The field filter allows you to restrict the field types allowed for that input parameter.
JSON Schema
The schema shows a shortened version of the parameter of your GP to highlight the filter with a range type.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "JSON Schema for Field Type Filter",
"description": "Schema defining a filter for ArcPy parameters that accept only certain field types.",
"type": "object",
"properties": {
"filter": {
"description": "Filter definition object.",
"type": "object",
"properties": {
"type": {
"description": "The type of filter.",
"type": "string",
"enum": ["field"]
},
"list": {
"description": "List of allowed field types.",
"type": "array",
"items": {
"type": "string",
"enum": [
"esriFieldTypeSmallInteger",
"esriFieldTypeInteger",
"esriFieldTypeSingle",
"esriFieldTypeDouble",
"esriFieldTypeString",
"esriFieldTypeDate",
"esriFieldTypeOID",
"esriFieldTypeGeometry",
"esriFieldTypeBlob",
"esriFieldTypeRaster",
"esriFieldTypeGUID",
"esriFieldTypeGlobalID",
"esriFieldTypeXML",
"esriFieldTypeBigInteger",
"esriFieldTypeDateOnly",
"esriFieldTypeTimeOnly",
"esriFieldTypeTimestampOffset"
]
},
"minItems": 1,
"uniqueItems": true
}
},
"required": ["type", "list"],
"additionalProperties": false
}
},
"required": ["filter"],
"additionalProperties": false
}JSON Example
{
"filter": {
"type": "field",
"list": ["esriFieldTypeSmallInteger"]
}
}File
The file filter can restrict the file extension allowed. Note that you may not upload a file without an extension whether you are using filter or not.
JSON Schema
The schema shows a shortened version of the parameter of your GP to highlight the filter with a file type.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "JSON Schema for File Type Filter",
"description": "Schema defining a filter for parameters that accept only certain file extensions.",
"type": "object",
"properties": {
"filter": {
"description": "Filter definition object.",
"type": "object",
"properties": {
"type": {
"description": "The type of filter.",
"type": "string",
"enum": ["file"]
},
"list": {
"description": "List of allowed file extensions (without dot).",
"type": "array",
"items": {
"type": "string",
"pattern": "^[a-zA-Z0-9]+$"
},
"minItems": 1,
"uniqueItems": true
}
},
"required": ["type", "list"],
"additionalProperties": false
}
},
"required": ["filter"],
"additionalProperties": false
}Coded Value Domain
The coded value domain can provide a mapping between the reference of a value and the value itself. It is available for localized strings and a choice list of layers.
Having this information can allow client applications to understand what values are actually being used, rather than the reference of the values themselves in the choice property.
While client application can continue to use choice, coded domain provides more information and is recommended for use over choice even in instances where you may not need to know the reference of the values.
Coded Value Domain for Localized Strings
Some tools have localized strings as a representation of the actual value being used when the tool is run. Starting at ArcGIS Enterprise 12.0, coded domain can provide the mapping between the localized string in the property name and the actual value being used in the property value.
Currently, you can only use existing localized strings from existing analysis tools. It is not possible to create a tool with a parameter with customized localized strings.
JSON Schema
This is the JSON schema for a parameter's filter object at the GP Task resource when that parameter has a coded domain.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"filter": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "codedValue"
},
"list": {
"type": "array",
"items": {
"type": "object",
"properties": {
"dataType": {
"type": "string",
"const": "GPString"
},
"name": {
"type": "string",
"description": "The localized string."
},
"value": {
"type": "string",
"description": "The actual value used by the tool."
}
},
"required": ["dataType", "name", "value"],
"additionalProperties": false
}
}
},
"required": ["type", "list"],
"additionalProperties": false
}
},
"required": ["filter"],
"additionalProperties": false
}JSON Example
For example, the Pairwise Buffer (Analysis) tool has the Dissolve Type parameter, which accepts 3 values: No Dissolve, Dissolve all output features into a single feature, and Dissolve features using the listed fields' unique values or combination of values. However, when the tool actual runs, these three string corresponds to NONE, ALL, LIST, respectively, and are the actual values used by the tool.
{
"filter": {
"type": "codedValue",
"list": [
{
"dataType": "GPString",
"name": "No Dissolve",
"value": "NONE"
},
{
"dataType": "GPString",
"name": "Dissolve all output features into a single feature",
"value": "ALL"
},
{
"dataType": "GPString",
"name": "Dissolve features using the listed fields' unique values or combination of values",
"value": "LIST"
}
]
}
}Coded Value Domain for Regular Strings
For actual strings, coded domains are still available. However, the name and value property will share the same value.
Coded Value Domain for a choice list of layers
Parameters containing a choice list of predefined layers are frequently used by many customized tools. The legacy choice property can only provide the name of the layers, but the schema for each layer is not available. With coded domain, the schema and applicable geometry type information are available.
When sending a validate request, if you have the return set to true, you will get the FeatureCollection back as updated coded value domain, which contains geometry type and drawing information in addition to the schema.
JSON Schema
This is the JSON schema for a parameter's filter object at the GP Task resource when that parameter has a coded domain for feature, tables and rasters.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "JSON Schema for codedValue Filter",
"description": "Schema defining a filter for codedValue type with a list of coded entries.",
"type": "object",
"properties": {
"filter": {
"description": "Filter definition object.",
"type": "object",
"properties": {
"type": {
"description": "The type of filter.",
"type": "string",
"enum": ["codedValue"]
},
"list": {
"description": "List of coded value entries.",
"type": "array",
"items": {
"type": "object",
"properties": {
"dataType": {
"description": "The data type of the coded value in this example.",
"type": "string",
"enum": [
"GPFeatureRecordSetLayer",
"GPRecordSet",
"GPRasterDataLayer"
]
},
"name": {
"description": "The layer or table name of the coded value entry.",
"type": "string"
},
"value": {
"description": "The schema of the layer or table. Geometry type and drawingInfo can be available too. Schema is skipped for allowed data types here.",
"type": "object"
}
},
"required": ["dataType", "name", "value"],
"additionalProperties": false
},
"minItems": 1,
"uniqueItems": true
}
},
"required": ["type", "list"],
"additionalProperties": false
}
},
"required": ["filter"],
"additionalProperties": false
}JSON Example
The following JSON shows the coded value domain for an input feature parameter with a choice list of two layers.
{
"filter": {
"type": "codedValue",
"list": [
{
"dataType": "GPFeatureRecordSetLayer",
"name": "polygonZ_FeatureToPoint1",
"value": {
"hasZ": true,
"features": [],
"exceededTransferLimit": false,
"displayFieldName": "",
"spatialReference": {
"latestWkid": 3857,
"wkid": 102100
},
"fields": [
{
"name": "OBJECTID",
"alias": "OBJECTID",
"type": "esriFieldTypeOID"
},
{
"name": "countshort",
"alias": "countshort",
"type": "esriFieldTypeSmallInteger"
},
{
"name": "geom",
"alias": "geom",
"type": "esriFieldTypeSingle"
},
{
"name": "ORIG_FID",
"alias": "ORIG_FID",
"type": "esriFieldTypeInteger"
}
],
"geometryType": "esriGeometryPoint"
}
},
{
"dataType": "GPFeatureRecordSetLayer",
"name": "polylinesZM1",
"value": {
"hasZ": true,
"features": [],
"hasM": true,
"exceededTransferLimit": false,
"displayFieldName": "",
"spatialReference": {
"latestWkid": 3857,
"wkid": 102100
},
"fields": [
{
"name": "OBJECTID",
"alias": "OBJECTID",
"type": "esriFieldTypeOID"
},
{
"name": "numberofver",
"alias": "num",
"type": "esriFieldTypeDouble"
},
{
"name": "record",
"length": 8,
"alias": "record",
"type": "esriFieldTypeDate"
},
{
"name": "Shape_Length",
"alias": "Shape_Length",
"type": "esriFieldTypeDouble"
}
],
"geometryType": "esriGeometryPolyline"
}
}
]
}
}Composite Domains
For the GPComposite and GPValueTable parameter, each data type in the composite, or each column in the value table, can have an individual filter.
The parameter-level composite filter contains each individual filter at the index corresponding to its data type or value-table column. Filter information is also available in the applicable parameter entry.
JSON Schema
The schema is the same for either the GP or GP parameter. For the schema for individual filter types, refer to the sections above. If any data type in your composite, or any column in your value table, does not have a filter set, you will see null as a place holder for the composite domain.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "JSON Schema for composite Filter",
"description": "Schema defining a composite filter with a list of filter components.",
"type": "object",
"properties": {
"filter": {
"description": "Filter definition object.",
"type": "object",
"properties": {
"type": {
"description": "The type of filter which will be composite.",
"type": "string",
"enum": ["composite"]
},
"list": {
"description": "List of filter components.",
"type": "array",
"items": {
"oneOf": [
{
"type": "null"
},
{
"type": "object",
"properties": {
"type": {
"description": "The type of the filter component.",
"type": "string",
"enum": [
"range",
"field",
"featureClass",
"file",
"codedValue",
"long",
"double",
"linearUnit",
"arealUnit",
"timeUnit",
"unit",
"boolean"
]
}
}
}
]
}
}
}
}
}
}JSON Example
In this example, it can be used for both GP and GP.
In the case of GP, this example shows a composite of a GP, GP, GP, GP that doesn't have a supported filter, and GP that has no filter set.
In the case of GP, this example shows a value table with five columns. They are GP, GP, GP, GP that doesn't have a supported filter, and GP that has no filter set.
{
"filter": {
"type": "composite",
"list": [
{
"type": "codedValue",
"list": [
{
"dataType": "GPString",
"name": "abc",
"value": "abc"
},
{
"dataType": "GPString",
"name": "def",
"value": "def"
},
{
"dataType": "GPString",
"name": "ghu",
"value": "ghu"
}
]
},
{
"type": "featureClass",
"list": [
"esriGeometryPoint",
"esriGeometryPolyline"
]
},
{
"type": "file",
"list": [
"pdf",
"txt"
]
},
null,
null
]
}
}Choice list
If your tool has a Value filter on a input string parameter, you will see the allowed strings in your Value filter become values in the Choice of the geoprocessing service task JSON. When you run the tool, only the values in the choice list are valid values. Providing other values will result an error indicating the value provided is not part of the choice list.
You may still see a coded domain as a filter while your parameter have an equivalent choice property.
JSON Schema
The schema shows a shortened version of the parameter of your GP to highlight the choice.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "JSON Schema for Choice List",
"description": "Schema defining a choice list for inputs with a ValueList filter.",
"type": "object",
"properties": {
"choiceList": {
"description": "For input with a choice list, or a ValueList filter.",
"type": "array",
"items": {
"description": "Individual choice on the list.",
"type": "string"
},
"uniqueItems": true
}
},
"required": ["choiceList"]
}Sample ChoiceList
{
"choiceList": ["A3", "A4", "Letter", "Legal"]
}