FRAMES | NO FRAMES Description | Parameters | Examples | Response
Query Jobs (Operation)
URL http://<jobs-url>/query
Parent Resource Jobs

Description

Executes a job query and returns the resulting set of records.

A job query can be specified in either of the following ways: Note: When the user store is set to Portal and user information changes in the Portal, it is required to reconnect to the service and run a query or report to refresh the user information in the database.

Refer to the ArcGIS documentation for a complete listing of the field type constant values.

Parameters

Parameter Details
f Description: The response format. The default response format is html.

Values: html | json
user Optional
Description: The username of the client.
id Required (for stored query)
Description: An integer value representing the ID of a query configured in the system.
fields Required (for ad-hoc query)
Description: The names of the fields that participate in the query. This list is a comma delimited list of field names.
aliases Description: The descriptions of the fields that participate in the query. This list is a comma delimited list of field aliases.
tables Required (for ad-hoc query)
Description: The names of the tables that participate in the query. This list is a comma delimited list of table names.
where Description: The where clause for the query.
orderBy Description: The name of the field by which to order the results. Only a single field name may be specified.

Example Usage

Example 1: URL for executing job query ID 5 in the "Workflow" service on sampleserver.

http://sampleserver/arcgis/rest/services/Workflow/WMServer/jobs/query?user=cjones&id=5

Example 2: URL for executing an ad-hoc job query in the "Workflow" service on sampleserver.

http://sampleserver/arcgis/rest/services/Workflow/WMServer/jobs/query?user=cjones&fields=JTX_JOBS.JOB_NAME,JTX_JOBS.DUE_DATE&aliases=Job%20Name,Due%20Date&tables=JTX_JOBS&where=JTX_JOBS.ASSIGNED_TO%3D'[SYS:CUR_LOGIN]'&orderBy=JTX_JOBS.DUE_DATE

JSON Response Syntax

{
  "fields": [
    { "name": "<fieldName1>", "alias": "<fieldAlias1>", "type": <fieldType1>, "length": <fieldLength1> },
    { "name": "<fieldName2>", "alias": "<fieldAlias2>", "type": <fieldType2>, "length": <fieldLength2> },
    ...
  ],
  "rows": [
    [ "<value11>", "<value12>", "<value13>", ... ],
    [ "<value21>", "<value22>", "<value23>", ... ],
    [ "<value31>", "<value32>", "<value33>", ... ],
    ...
  ]
}

JSON Response Example

{
  "fields": [
    { "name": "JTX_JOBS.JOB_ID", "alias": "Job ID", "type": 1, "length": 4 },
    { "name": "JTX_JOBS.ASSIGNED_TO", "alias": "Assigned To", "type": 4, "length": 50 },
    { "name": "JTX_JOBS.DUE_DATE", "alias": "Due Date", "type": 5, "length": 36 }
  ],
  "rows": [
    [ "12", "cjones", "5/31/2010" ],
    [ "14", "GIS Analysts", "6/15/2010" ],
    [ "19", "", "7/1/2010" ]
  ]
}