Skip To Content
ArcGIS Developer
Dashboard

Geoprocessing services data types

The majority of the parameters that you include in a request are dependent on the input parameter types of the geoprocessing task you are submitting. The geoprocessing execute and submitJob operations share the same syntax for all input parameter types. For outputs, the result data syntax may be different from the inputs.

The data types listed in this topic are the data types supported on the server side. To learn more about supported data types from the publishing client, and how unsupported data types are converted during the publish process, see Geoprocessing task settings and related topics if you publish from ArcGIS Desktop. If you publish from ArcGIS Pro, see Input and output parameters.

GPFeatureRecordSetLayer

Input

The input parameter value for the GPFeatureRecordSetLayer data type is a JSON structure containing the url or itemID field, or the geometryType, hasZ, hasM, spatialReference, fields, and features fields.

  • features—An array of features. Each feature is defined with the following properties:
    • geometry—Points, lines, or polygons. The structure for the geometries is the same as the structure of the JSON geometry objects returned by ArcGIS REST API.
    • attributes—Key-value pairs in which the key is a field name in the list of fields of the record set and the value is the value of the corresponding field.
  • spatialReference—The well-known ID (WKID) of a spatial reference. This is optional.
  • geometryType—The geometry type of the GPFeatureRecordsSetLayer. This is optional.
  • hasZ=true—The GPFeatureRecordSetLayer includes z-values. This is optional.
  • hasM=true—The GPFeatureRecordSetLayer includes m-values. This is optional.
  • fields—Contains name, alias, and fieldType properties for the fields returned in the response. This is optional.

If GPFeatureRecordSetLayer contains geometry with z- or m-values, it must include the hasZ or hasM property, respectively, at the feature set level.

FeatureSet syntax

{
    "geometryType": "<geometryType>",
    "hasZ": <true|false>,
    "hasM": <true|false>,
    "spatialReference": {spatialReference
    },
    "fields": [
        {
            "name": "<field1>",
            "type": "<field1Type>",
            "alias": "<field1Alias>"
        },
        {
            "name": "<field2>",
            "type": "<field2Type>",
            "alias": "<field2Alias>"
        }
    ],
    "features": [
        {
            "geometry": {
                        <geometry1>
            },
            "attributes": {
                "<field1>": <value11>,
                "<field2>": <value12>
            }
        },
        {
            "geometry": {
                        <geometry2>
            },
            "attributes": {
                "<field1>": <value21>,
                "<field2>": <value22>
            }
        }
    ]
}

FeatureCollection syntax

{
    "layerDefinition": {
        "name": "<name>",
        "type": "Feature Layer",
        "geometryType": "<geometryType>",
        "objectIdField": "<FieldName>",
        "fields": [
            {
                "name": "<field1>",
                "type": "<field1Type>",
                "alias": "<field1Alias>"
            },
            {
                "name": "<field2>",
                "type": "<field2Type>",
                "alias": "<field2Alias>"
            }
        ],
        "drawingInfo": {
            "renderer": {<renderer>
            }
        },
        "templates": [<template>
        ]
    },
    "featureSet": {
        "displayFieldName": "<displayFieldName>",
        "geometryType": "<geometryType>",
        "spatialReference": {<spatialReference>
        },
        "features": [
            {
                "attributes": {
                    "<field1>":<value1>,
                    "<field2>":<value2>,
                },
                "geometry": {<geometry1>
                }
            },
            {
                "attributes": {
                    "<field1>":<value11>,
                    "<field2>":<value22>,
                },
                "geometry": {<geometry2>
                }
            }
        ]
    }
}

Layer URL syntax

To specify a feature service layer or map service layer, provide the URL to the layer. An optional attribute filter can be added. Starting at 10.7.1, instead of querying time-enabled map service layers or time-enabled feature service layers, a time filter can be specified. Time can be filtered as a single instant or by separating the two ends of a time extent with a comma.

{ 
    "url": "<url of a map service or a feature service layer>",
    "filter": <attribute expression>,
    "time": <time value>
}

itemID syntax

For a large set of geometries, you can specify an uploaded item as input for geoprocessing services that support uploads, which is one of the Child Resources values of the geoprocessing service. The item ID will be available once you use the Upload Item operation to upload a JSON-based .txt file, or a .json file. The itemID of your portal item is not supported regardless of the type of item, even if your server is federated.

{
    "itemID" : "<itemID>" 
}

Example 1: FeatureSet result

{
    "geometryType": "esriGeometryPoint",
    "spatialReference": {
        "wkid": 4326
    },
    "fields": [
        {
            "name": "Id",
            "type": "esriFieldTypeOID",
            "alias": "Id"
        },
        {
            "name": "Name",
            "type": "esriFieldTypeString",
            "alias": "Name"
        }
    ],
    "features": [
        {
            "geometry": {
                "x": -104.44,
                "y": 34.83
            },
            "attributes": {
                "Id": 43,
                "Name": "Feature 1"
            }
        },
        {
            "geometry": {
                "x": -100.65,
                "y": 33.69
            },
            "attributes": {
                "Id": 67,
                "Name": "Feature 2"
            }
        }
    ]
}

Example 2: FeatureSet without a schema

In cases in which the input geometryType, spatialReference, and fields values match the default values, the input GPFeatureRecordSetLayer can exclude geometryType, spatialReference, and fields information. The geometryType, spatialReference, and fields values will be the default values if no other values are provided.

The geometryType can be esriGeometryPoint, esriGeometryPolyline, or esriGeometryPolygon. If the geometry type is not specified, it defaults to esriGeometryPoint. If spatialReference is not specified, it defaults to an unknown coordinate system.

{
    "features": [
        {
            "geometry": {
                "x": -104.44,
                "y": 34.83
            },
            "attributes": {
                "Id": 43,
                "Name": "Feature 1"
            }
        },
        {
            "geometry": {
                "x": -100.65,
                "y": 33.69
            },
            "attributes": {
                "Id": 67,
                "Name": "Feature 2"
            }
        }
    ]
}

Example 3: hasZ or hasM

Provide the hasZ or hasM property for feature sets that contain z- or m-values, respectively. The following example has z-values:

{
    "geometryType": "esriGeometryPoint",
    "hasZ": true,
    "spatialReference": {
        "wkid": 4326
    },
    "fields": [
        {
            "name": "Id",
            "type": "esriFieldTypeOID",
            "alias": "Id"
        },
        {
            "name": "Name",
            "type": "esriFieldTypeString",
            "alias": "Name"
        }
    ],
    "features": [
        {
            "geometry": {
                "x": -104.44,
                "y": 34.83,
                "z": 10.0
            },
            "attributes": {
                "Id": 43,
                "Name": "Feature 1"
            }
        },
        {
            "geometry": {
                "x": -100.65,
                "y": 33.69,
                "z": 11.0
            },
            "attributes": {
                "Id": 67,
                "Name": "Feature 2"
            }
        }
    ]
}

Example 4: URL to geometries or feature queries

For a large set of geometries, you can specify a URL to the input geometries stored in a JSON structure in a file on a public server. The URL value can also be a URL to an operation such as a MapService or FeatureService query that returns a JSON feature set.

{
    "url": "https://myserver/myfeatures/afile.txt"
}
{
    "url": "https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer/0/query?where=1%3D1&f=json"
}

Example 5: ItemID of an uploaded item

Once you upload the .json or .txt file, you will get a unique itemID, such as i1057fd92-669e-40c0-98c8-cf1b0500fa13.

Specify the itemID you obtained using the Upload Item operation.

{
    "itemID":"i1057fd92-669e-40c0-98c8-cf1b0500fa13"
}

Example 6: URL of a service with an attribute filter

You can specify the URL of a map service layer or a feature service layer.

Specify the commercial damage assessment layer from a feature service on sampleserver6 with no filter.

{
    "url": "https://sampleserver6.arcgisonline.com/arcgis/rest/services/CommercialDamageAssessment/FeatureServer/0"
}

Filter the citizen requests layer from a map service on sampleserver6, with an attribute filter selecting requests having a level 2 severity and null names.

{
    "url": "https://sampleserver6.arcgisonline.com/arcgis/rest/services/LocalGovernment/CitizenRequests/MapServer/0",
    "filter": "severity=2 and name is null"
}

Example 7: Time filter

Starting at 10.7.1, instead of querying time-enabled map service layers or time-enabled feature service layers, a time filter can be specified. Time can be filtered as a single instant or by separating the two ends of a time extent with a comma.

Specify a single time instant.

{
    "url": "https://myserver/../myservicename/FeatureServer/0",
    "time": 967855732000
}

Specify a time extent (including null on either end of the extent).

{
    "url": "https://myserver/../myservicename/FeatureServer/0",
    "time": "967855732000,null"
}

Output

FeatureSet output

If the geoprocessing service is not associated with a result map service or if the returnType parameter is set to data, the parameter value for GPFeatureRecordSetLayer is a JSON structure that is the same as FeatureSet input for GPFeatureRecordSetLayer.

If the geoprocessing service is associated with a result map service, the default output for the GPFeatureRecordSetLayer parameter is a map image. However, you can explicitly request the feature data using the returnType parameter in the URL and set its value to data.

Note:

The exceededTransferLimit property is true only if the number of records exceeds the maximum number configured by the server administrator. Otherwise, it is set to false.

JSON Response syntax

{
    "paramName": "<paramName>",
    "dataType": "GPFeatureRecordSetLayer",
    "value": {
        "geometryType": "<geometryType>",
        "hasZ": <true|false>,
        "hasM": <true|false>,
        "spatialReference": {<spatialReference>
        },
        "fields": [
            {
                "name": "<field1>",
                "type": "<field1Type>",
                "alias": "<field1Alias>"
            },
            {
                "name": "<field2>",
                "type": "<field2Type>",
                "alias": "<field2Alias>"
            }
        ],
        "features": [
            {
                "geometry": {<geometry1>
                },
                "attributes": {
                    "<field1>": <value11>,
                    "<field2>": <value12>
                }
            },
            {
                "geometry": {<geometry2>
                },
                "attributes": {
                    "<field1>": <value21>,
                    "<field2>": <value22>
                }
            }
        ]
    }
}

JSON Response example

{
    "paramName": "Output_Features",
    "dataType": "GPFeatureRecordSetLayer",
    "value": {
        "geometryType": "esriGeometryPoint",
        "hasZ": true,
        "spatialReference": {
            "wkid": 4326
        },
        "fields": [
            {
                "name": "OBJECTID",
                "type": "esriFieldTypeOID",
                "alias": "OBJECTID"
            },
            {
                "name": "TextField",
                "type": "esriFieldTypeString",
                "alias": "TextField"
            },
            {
                "name": "IntField",
                "type": "esriFieldTypeInteger",
                "alias": "IntegerField"
            },
            {
                "name": "DoubleField",
                "type": "esriFieldTypeDouble",
                "alias": "DoubleField"
            },
            {
                "name": "DateField",
                "type": "esriFieldTypeDate",
                "alias": "DateField"
            }
        ],
        "features": [
            {
                "geometry": {
                    "x": -104.36,
                    "y": 34.657,
                    "z": 10.0
                },
                "attributes": {
                    "OBJECTID": 1,
                    "TextField": "a",
                    "IntField": 1234,
                    "DoubleField": 1234.56,
                    "DateField": 229564800000
                }
            },
            {
                "geometry": {
                    "x": -114.749,
                    "y": 31.439,
                    "z": 11.0
                },
                "attributes": {
                    "OBJECTID": 2,
                    "TextField": "b",
                    "IntField": 5678,
                    "DoubleField": 5678.91,
                    "DateField": 239564800000
                }
            }
        ]
    }
}

FeatureCollection output

If the geoprocessing service is not associated with a result map service, and returnFeatureCollection is set to true, the parameter value for GPFeatureRecordSetLayer is a JSON structure with the following properties:

  • layerDefinition—Contains the name, type, geometryType, objectIdField, fields, and drawingInfo properties.
  • featureSet—Contains the displayFieldName, geometryType, spatialReference, and features properties.

JSON Response syntax

{
    "paramName": "<paramName>",
    "dataType": "GPFeatureRecordSetLayer",
    "value": {
        "layerDefinition": {
            "name": "<name>",
            "type": "Feature Layer",
            "geometryType": "<geometryType>",
            "objectIdField": "<FieldName>",
            "fields": [
                {
                    "name": "<field1>",
                    "type": "<field1Type>",
                    "alias": "<field1Alias>"
                },
                {
                    "name": "<field2>",
                    "type": "<field2Type>",
                    "alias": "<field2Alias>"
                }
            ],
            "drawingInfo": {
                "renderer": {<renderer>
                }
            },
            "templates": [<template>
            ]
        },
        "featureSet": {
            "displayFieldName": "<displayFieldName>",
            "geometryType": "<geometryType>",
            "spatialReference": {<spatialReference>
            },
            "features": [
                {
                    "attributes": {
                        "<field1>":<value1>,
                        "<field2>":<value2>,
                    },
                    "geometry": {<geometry1>
                    }
                },
                {
                    "attributes": {
                        "<field1>":<value11>,
                        "<field2>":<value22>,
                    },
                    "geometry": {<geometry2>
                    }
                }
            ],
            "exceededTransferLimit":<true or false>
        }
    }
}

JSON Response example

{
    "paramName": "Output_Feature_Class",
    "dataType": "GPFeatureRecordSetLayer",
    "value": {
        "layerDefinition": {
            "name": "Output Feature Class",
            "type": "Feature Layer",
            "geometryType": "esriGeometryPolygon",
            "objectIdField": "OBJECTID",
            "fields": [
                {
                    "name": "OBJECTID",
                    "type": "esriFieldTypeOID",
                    "alias": "OBJECTID"
                },
                {
                    "name": "Shape",
                    "type": "esriFieldTypeGeometry",
                    "alias": "Shape"
                },
                {
                    "name": "X",
                    "type": "esriFieldTypeInteger",
                    "alias": "X"
                },
                {
                    "name": "Y",
                    "type": "esriFieldTypeInteger",
                    "alias": "Y"
                },
                {
                    "name": "UserName",
                    "type": "esriFieldTypeString",
                    "alias": "UserName",
                    "length": 50
                },
                {
                    "name": "BUFF_DIST",
                    "type": "esriFieldTypeDouble",
                    "alias": "BUFF_DIST"
                },
                {
                    "name": "ORIG_FID",
                    "type": "esriFieldTypeInteger",
                    "alias": "ORIG_FID"
                },
                {
                    "name": "Shape_Length",
                    "type": "esriFieldTypeDouble",
                    "alias": "Shape_Length"
                },
                {
                    "name": "Shape_Area",
                    "type": "esriFieldTypeDouble",
                    "alias": "Shape_Area"
                }
            ],
            "drawingInfo": {
                "renderer": {
                    "type": "simple",
                    "symbol": {
                        "type": "esriSFS",
                        "style": "esriSFSSolid",
                        "color": [
                            252,
                            193,
                            184,
                            255
                        ],
                        "outline": {
                            "type": "esriSLS",
                            "style": "esriSLSSolid",
                            "color": [
                                110,
                                110,
                                110,
                                255
                            ],
                            "width": 0.7
                        }
                    }
                }
            },
            "templates": []
        },
        "featureSet": {
            "displayFieldName": "",
            "geometryType": "esriGeometryPolygon",
            "spatialReference": {
                "wkid": 26944,
                "latestWkid": 26944
            },
            "features": [
                {
                    "attributes": {
                        "OBJECTID": 1,
                        "X": 1959000,
                        "Y": 642000,
                        "UserName": null,
                        "BUFF_DIST": 152.40030480060963,
                        "ORIG_FID": 1,
                        "Shape_Length": 957.5593559328076,
                        "Shape_Area": 72966.16885441207
                    },
                    "geometry": {
                        "curveRings": [
                            [
                                [
                                    1959000,
                                    642152.4002999999
                                ],
                                {
                                    "a": [
                                        [
                                            1959000,
                                            642152.4002999999
                                        ],
                                        [
                                            1959000,
                                            641999.9999951993
                                        ],
                                        0,
                                        1
                                    ]
                                }
                            ]
                        ]
                    }
                },
                {
                    "attributes": {
                        "OBJECTID": 2,
                        "X": 1959000,
                        "Y": 641000,
                        "UserName": null,
                        "BUFF_DIST": 152.40030480060963,
                        "ORIG_FID": 2,
                        "Shape_Length": 957.5593559328076,
                        "Shape_Area": 72966.16885441207
                    },
                    "geometry": {
                        "curveRings": [
                            [
                                [
                                    1959000,
                                    641152.4002999999
                                ],
                                {
                                    "a": [
                                        [
                                            1959000,
                                            641152.4002999999
                                        ],
                                        [
                                            1959000,
                                            640999.9999951993
                                        ],
                                        0,
                                        1
                                    ]
                                }
                            ]
                        ]
                    }
                }
            ],
            "exceededTransferLimit": false
        }
    }
}

Feature service output

If the asynchronous geoprocessing service is not associated with a result map service, and the output feature service name is provided during the service consumption, the parameter value for the GPFeatureRecordSetLayer or GPRecordSetLayer data type is a JSON structure with only one property: the URL of the result output feature service.

JSON Response syntax

{
    "paramName": "<paramName>",
    "dataType": "GPFeatureRecordSetLayer" | "GPRecordSet",
    "value": {
        "url": "<URL to a result feature service layer>"
    }
}

JSON Response example

{
    "paramName": "ResultPolygons",
    "dataType": "GPFeatureRecordSetLayer",
    "value": {"url": "https://myserver/server/rest/services/Hosted/outputFeatureServiceName/FeatureServer/0"}
}

GPRecordSet

Input

The input parameter value for a GPRecordSet data type is a JSON structure containing the features and fields fields, the url field, or the itemID field.

The features field is an array of features. Each feature contains an attributes field in which the key is a field name in the list of fields of the record set, and the value is the value for the corresponding field.

GPRecordSet syntax

{
    "fields": [
        {
            "name": "<field1>",
            "type": "<field1Type>",
            "alias": "<field1Alias>"
        },
        {
            "name": "<field2>",
            "type": "<field2Type>",
            "alias": "<field2Alias>"
        }
    ],
    "features": [
        {
            "attributes": {
                "<field1>": <value11>,
                "<field2>": <value12>
            }
        },
        {
            "attributes": {
                "<field1>": <value21>,
                "<field2>": <value22>
            }
        }
    ]
}

Layer URL syntax

The input of GPRecordSet can be the URL of a table layer.

{
    "url": "<url of a table layer>"
}

Output

The output parameter value for a GPRecordSet data type is a JSON structure with the features field.

The features field is an array of features. Each feature contains an attributes field. The attributes field consists of key-value pairs in which the key is a field name in the list of fields of the record set, and the value is the value of the corresponding field.

Note:

The exceededTransferLimit property is true only if the number of records exceeds the maximum number configured by the server administrator. Otherwise, it is false.

JSON Response syntax

{
    "paramName": "<paramName>",
    "dataType": "GPRecordSet",
    "value": {
        "fields": [
            {
                "name": "<field1>",
                "type": "<field1Type>",
                "alias": "<field1Alias>"
            },
            {
                "name": "<field2>",
                "type": "<field2Type>",
                "alias": "<field2Alias>"
            }
        ],
        "features": [
            {
                "attributes": {
                    "<field1>": <value11>,
                    "<field2>": <value12>
                }
            },
            {
                "attributes": {
                    "<field1>": <value21>,
                    "<field2>": <value22>
                }
            }
        ],
        "exceededTransferLimit": false | true
    }
}

JSON Response example

{
    "paramName": "Output_Record_Set",
    "dataType": "GPRecordSet",
    "value": {
        "fields": [
            {
                "name": "OBJECTID",
                "type": "esriFieldTypeOID",
                "alias": "OBJECTID"
            },
            {
                "name": "TextField",
                "type": "esriFieldTypeString",
                "alias": "TextField"
            },
            {
                "name": "IntField",
                "type": "esriFieldTypeInteger",
                "alias": "IntegerField"
            },
            {
                "name": "DoubleField",
                "type": "esriFieldTypeDouble",
                "alias": "DoubleField"
            },
            {
                "name": "DateField",
                "type": "esriFieldTypeDate",
                "alias": "DateField"
            }
        ],
        "features": [
            {
                "attributes": {
                    "TextField": "a",
                    "IntField": 1234,
                    "DoubleField": 1234.56,
                    "DateField": 229564800000
                }
            },
            {
                "attributes": {
                    "TextField": "b",
                    "IntField": 5678,
                    "DoubleField": 5678.91,
                    "DateField": 239564800000
                }
            }
        ],
        "exceededTransferLimit": false
    }
}

Output feature service

The output can be a feature service. See Feature service output above.

GPRasterDataLayer

Input

The input parameter value for a GPRasterDataLayer data type is a JSON structure with the url field, which is the URL to the location of the input raster data file.

{ 
    "url": "https://myserver/lake.tif"
}

For geoprocessing services that support uploads, you can specify an uploaded item as input to GPRasterDataLayer as follows:

{
    "itemID": "<itemID>"
}

At 10.8, a URL to an image service is supported as an input, provided the tool supports an image service as input.

{
    "url": "<url to your image service>"
}

Example

Use the NDFD wind data from sampleserver 6.

{
    "url": "https://sampleserver6.arcgisonline.com/arcgis/rest/services/ScientificData/NDFD_wind/ImageServer"
}

Output

The output parameter value for a GPRasterDataLayer data type is a JSON structure with the following fields:

  • url—A URL to the location of the raw raster data
  • format—A string representing the format of the raster

JSON Response syntax

{
    "paramName": "<paramName>",
    "dataType": "GPRasterDataLayer",
    "value": {
        "url": "<url>",
        "format": "<format>"
    }
}

JSON Response example

{
    "paramName": "Output_Raster_Layer",
    "dataType": "GPRasterDataLayer",
    "value": {
        "url": "https://flame7/arcgisjobs/ByRefTools_GPServer/J3D1737BA4584441FACBD5563AD1A47D5/scratch/outrast.tif",
        "format": "tif"
    }
}

Field

Field is supported at 10.7. For information about specific requirements to publish a web tool with a Field input, see Input and output parameters.

Input

The name and type fields are required. The alias, editable, nullable, and length fields are optional.

Field syntax

{
    "name": "<Field name>",
     "type": "<Field type>",
    "alias": "<Field alias>",
    "editable": false | true,
    "nullable": false | true,
    "length": <Field length>
}

Example

{
    "name": "distance",
    "type": "esriFieldTypeInteger",
    "alias": "int",
    "editable": true,
    "nullable": true,
    "length": 4
}

Output

JSON Response syntax

{
    "paramName": "<paramName>",
    "dataType": "Field",
    "value": {
         "name": "<FieldName>",
         "type": "<FieldType>",
         "alias": "<Field alias>",
         "editable": false | true,
         "nullable": false | true,
         "length": <Field length>
    }
}

JSON Response example

{
    "paramName": "Probability_Field",
    "dataType": "Field",
    "value": {
        "name": "GiPValue",
        "type": "esriFieldTypeInteger",
        "alias": "GiPValue",
        "editable": true,
        "nullable": true,
        "length": 0
    }
}

GPDataFile

Input

The input parameter value for GPDataFile is a JSON structure with a url field. The value of the url field is a URL to the location of the input file.

URL syntax:

{ 
    "url": "https://myserver/myfile" 
}

For geoprocessing services that support uploads, you can specify an uploaded item as input to GPDataFile as follows:

ArcGIS Server item ID syntax.

{
    "itemID": "<itemID>" 
}

At 10.8, you can specify a portal item ID as an input when you publish geoprocessing services to a federated server. To find the ID of a portal item, this blog post describes a similar process for ArcGIS Online.

Portal item ID syntax

{
    "portalItemID": "<portalItemID>" 
}

Output

The output parameter value for a GPDataFile data type is a JSON structure with a url field. The value of the url field is a URL to the location of the output file.

JSON Response syntax

{
    "paramName": "<paramName>",
    "dataType": "GPDataFile",
    "value": {
        "url": "<url>" 
    }
}

JSON Response example

{
    "paramName": "Output_File",
    "dataType": "GPDataFile",
    "value": {
        "url": "https://flame7/arcgisjobs/ByValTools_GPServer/J1E7A1738AC054CDCBFC4A413DD9033CE/scratch/output.txt"
    }
}

GPBoolean, GPDouble, GPLong, and GPString

Input

For simple data types and the GPBoolean, GPDouble, GPLong, and GPString parameter values, use their literal values.

InputBoolean=true&InputDouble=345.678&InputLong=345&InputString=MyString

Output

These simple data types have parameter values that are their literal values.

JSON Response syntax

{
    "paramName": "<paramName>",
    "dataType": "<GPBoolean | GPDouble | GPLong | GPString>",
    "value": <valueLiteral>
}

JSON Response example

{
    "paramName": "Output_Double",
    "dataType": "GPDouble",
    "value": 1234.56
}

GPLinearUnit

Input

The input parameter value for a GPLinearUnit data type is a JSON structure with the following fields:

  • distance—A double value
  • units—A string with unit values such as esriMeters or esriMiles

{
    "distance": 345.678,
    "units": "esriMiles"
}

Output

The output parameter value for a GPLinearUnit data type is a JSON structure with the following fields:

  • distance—A double value
  • units—A string with a value of esriMeters, esriMiles, and so on

JSON Response syntax

{
    "paramName": "<paramName>",
    "dataType": "GPLinearUnit",
    "value": {
        "distance": <distance>,
        "units": "<units>"
    }
}

JSON Response example

{
    "paramName": "Output_Linear_Unit",
    "dataType": "GPLinearUnit",
    "value": {
        "distance": 1234.56,
        "units": "esriMiles"
    }
}

GPDate

The parameter value for a GPDate data type is a number that represents the number of milliseconds since epoch (January 1, 1970) in UTC.

Input

The value corresponds to 1 Jan 2008 00:00:00 GMT.

InputDate=1199145600000

Output

JSON Response syntax

{
    "paramName": "<paramName>",
    "dataType": "GPDate",
    "value": <millisecondsSinceEpoch>
}

JSON Response example

The value corresponds to 1 Jan 2008 00:00:00 GMT.

{
    "paramName": "Output_Date",
    "dataType": "GPDate",
    "value": 1199145600000
}

GPMultiValue

Input

The fully qualified data type for the GPMultiValue parameter is GPMultiValue:<memberDataType> in which memberDataType is one of the data types defined above, for example, GPMultiValue:GPString, GPMultiValue:GPLong, and so on. All geoprocessing data types other than GPValueTable are supported by GPMultiValue.

The input parameter value for a GPMultiValue data type is a JSON array. Each element in this array is of the data type defined by the memberDataType suffix of the fully qualified GPMultiValue data type name.

Example 1: Using GPFeatureRecordSetLayer

GPMultiValue:GPFeatureRecordSetLayer data type using three local government feature service layers from sampleserver6:

[
    {
        "url": "https://sampleserver6.arcgisonline.com/arcgis/rest/services/LocalGovernment/CatchbasinInspections/FeatureServer/0"
    },
    {
        "url": "https://sampleserver6.arcgisonline.com/arcgis/rest/services/LocalGovernment/CitizenRequests/FeatureServer/0"
    },
    {
        "url": "https://sampleserver6.arcgisonline.com/arcgis/rest/services/LocalGovernment/Events/FeatureServer/0"
    }
]

Example 2: Using GPString

GPMultiValue:GPString data type:

["Parcels", "Street Lights"]

Example 3: Using GPLinearUnit

GPMultiValue:GPLinearUnit data type:

[
    {
        "distance": 345.67,
        "units": "esriMiles"
    },
    {
        "distance": 36,
        "units": "esriMiles"
    }
]

Output

All geoprocessing data types other than GPValueTable are supported in the GPMultiValue parameter.

The fully qualified data type for the GPMultiValue parameter is GPMultiValue:<memberDataType> in which memberDataType is one of the data types defined above, for example, GPMultiValue:GPString, GPMultiValue:GPLong, and so on.

The output parameter value for a GPMultiValue data type is a JSON array.

JSON Response example 1

GPMultiValue:GPStringdata type

{
    "paramName": "Output_Layers",
    "dataType": "GPMultiValue:GPString",
    "value": ["Parcels", "Street Lights"]
}

JSON Response example 2

GPMultiValue:GPLinearUnit data type

{
    "paramName": "Output_Distances",
    "dataType": "GPMultiValue:GPLinearUnit",
    "value": [
        {
            "distance": 345.67,
            "units": "esriMiles"
        },
        {
            "distance": 36,
            "units": "esriMiles"
        }
    ]
}

GPValueTable

A value table is a flexible table-like object, consisting of rows and columns containing various values. To learn more about value tables, see ValueTable. All other data types, other than GPMultiValue, can be a value in a GPValueTable.

Input

You can create a GPValueTable using an array of arrays or JSON with column names. If all of the columns have unique names that are not empty, you can use both syntaxes described below. Otherwise, you must use the array of arrays syntax.

Array of arrays syntax

For the array of arrays syntax, the outer array contains all JSON arrays representing each row of a value table. For the JSON array representing values of each column in a row, the sequence of those values must match the value table columns in the tool. For example, if each row of a value table requires a string, a number, and a Boolean as the three columns, you must pass the value in that order. In the case of an empty string, use "" as the placeholder. For all other types, use null as a placeholder for an empty value.

Array of arrays example 1

A value table input with three columns and three rows

This example shows a GPValueTable input with three columns and three rows. The first column is a GPLong data type, the second is a GPString data type, and the third is a GPFeatureRecordSetLayer data type.

[
    [
        0,
        "first row second column string",
        {
            "url": "https://myserver.com/server/rest/services/Hosted/myfs/FeatureServer/0"
        }
    ],
    [
        1,
        "second row second column string",
        {
            "spatialReference": {
                "wkid": 102100
            },
            "features": [
                {
                    "attributes": {
                        "ID": 0
                    },
                    "geometry": {
                        "x": -84.2868721699999,
                        "y": 41.593834992
                    }
                },
                {
                    "attributes": {
                        "ID": 1
                    },
                    "geometry": {
                        "x": -80.8615858519999,
                        "y": 38.955970817
                    }
                }
            ]
        }
    ],
    [
        2,
        "third row second column string",
        {
            "url": "https://myserver.com/server/rest/services/mymapservice/MapServer/3"
        }
    ]
]

Array of arrays example 2

A value table input with four columns and two rows

This example shows a GPValueTable input with four columns and two rows. The first column is a GPString, the second column is a GPLinearUnit, the third column is a GPBoolean, and the last column is a GPRasterDataLayer. Some of them do not have values, so a null or an empty string is a placeholder for the value.

[
    [
        "",
        {
            "distance": 10,
            "units": "esriKilometers"
        },
        true,
        null
    ],
    [
        "first column second row string",
        null,
        null,
        {
            "url": "https://myserver.com/server/rest/services/myImageService/ImageServer"
        }
    ]
]

Column name syntax

The column name syntax requires all columns of a value table to have a unique column name that is not empty. This syntax allows the flexibility to provide values in any order, because the unique column names allow the values to match the value table correctly. In the case of an empty value, that column name and key-value pair can be absent or you can provide an empty string or null as the value.

Column name example 1

A value table input with two columns and two rows

This example shows a GPValueTable input with two columns and four rows. The first column is a GPLong and the second column is a GPRecordSet. For empty values, this example shows a null value.

[
    {
        "myGPLongColumn": 0,
        "myTableColumn": null,
    },
    {
        "myGPLongColumn": null,
        "myTableColumn": {
            "features": [
                {
                    "attributes": {
                        "ObjectId": 1,
                        "TextFld": "SampleText",
                        "DateFld": 282096000000
                    }
                }
            ]
        }
    }
]

Column name example 2

A value table input with two columns and two rows, which is the same as above

This is the same GPValueTable as the Column name example 1 above, except instead of showing columns with null value, this example omits those columns in corresponding rows.

[
    {
        "myGPLongColumn": 0
    },
    {
        "myTableColumn": {
            "features": [
                {
                    "attributes": {
                        "ObjectId": 1,
                        "TextFld": "SampleText",
                        "DateFld": 282096000000
                    }
                }
            ]
        }
    }
]

Output

By default, the array of array format will be the output for a GPValueTable. To retrieve the column names along with all values, use the returnColumnName=True option for operations related to execute or GPResult.

Array of arrays syntax

The value of each column in a row will be based on the order of the columns in a value table parameter. If there is an empty value, an empty string in the case of GPString and null for all other data types will be placeholders for that value.

Array of arrays example 1

A value table output with three columns and two rows

This sample output shows a value table with two rows and columns. The first column is a GPBoolean, the second column is a GPString, and the third column is a GPLinearUnit.

[
    [
        true,
        "first row second column",
        null
    ],
    [
        null,
        "",
        {
            "distance": 5,
            "units": "esriMiles"
        }
    ]
]

Column name syntax

The column name syntax will show all column names, along with corresponding values, for all rows in a value table. Even if there are columns with null values, the column name will still show null in the JSON response. You cannot hide those column names with null values, unlike the input. If there are duplicate column names, or if a column does not have a name, an error occurs when using the returnColumnName=True option. The order of columns will follow the order of the columns defined in a value table parameter. To use this column name syntax for synchronous jobs, see Execute GP task. To use this column name syntax for asynchronous jobs, see GP Result.

Column name example 1

A value table output with three columns and two rows

This sample shows the same output as the array of arrays output sample 1. For columns with null values, the column name still shows.

[
    {
        "myBooleanColumn": true,
        "myStringColumn": "first row second column",
        "myLinearUnitColumn": null
    },
    {
        "myBooleanColumn": null,
        "myStringColumn": "",
        "myLinearUnitColumn": {
            "distance": 5,
            "units": "esriMiles"
        }
    }
]