FRAMES | NO FRAMES Description | Parameters | Examples | Response
Create Query (Operation)
URL http://<wmservice-url>/publicQueries/createQuery
Parent Resource Public Queries

Description

This operation is supported from 10.3.1 onwards.

Creates a public query.

Parameters

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

Values: html | json
user Required
Description: The username of the person who makes the create query request. The person must have AdministratorAccess Privilege to create public queries.
properties Required
Description: A JSON object containing the public query property values to update.

  • name: Required The name of the query.
  • fields: Required The names of the fields that participate in the query. This list is a comma delimited list of field names.
  • aliases: The descriptions of the fields that participate in the query. This list is a comma delimited list of field aliases.
  • tables: Required The names of the tables that participate in the query. This list is a comma delimited list of table names.
  • where: where clause for the query.
  • orderBy: The name of the field by which to order the results. Only a single field name may be specified.
  • containerId: The query container ID of the query. If no containerId is specified, the new query will be created in the "PublicQuery" container as the parent container.

Syntax:

{
  "name":"<queryName>",
  "fields":"<fieldList>",
  "aliases":"<aliasList>",
  "tables":"<tableList>",
  "where":"<whereclause>",
  "orderBy":"<orderByField>",
  "containerId":"<containerId>"
}

Example Usage

Example 1: URL for creating the public query named "All Jobs" in the "Workflow" service on sampleserver. The person who makes the request is "admin0000".

http://sampleserver/arcgis/rest/services/Workflow/WMServer/publicQueries/createQuery?user=admin0000&properties={"name":"All+Jobs","fields":"WMX.JTX_JOBS.JOB_ID,WMX.JTX_STATUS.NAME,WMX.JTX_USERS.FULL_NAME","tables":"WMX.JTX_JOBS,WMX.JTX_STATUS,WMX.JTX_USERS"}&f=pjson

Example 2: URL for creating the public query named "ClosedJobs" in the "Workflow" service on sampleserver. The person who makes the request is "admin0000". The query will return all closed jobs with job status as "Closed" and be created in query container with containerId "2".

http://sampleserver/arcgis/rest/services/Workflow/WMServer/publicQueries/createQuery?user=admin0000&properties={"name":"ClosedJobs","fields":"WMX.JTX_JOBS.JOB_ID,WMX.JTX_STATUS.NAME,WMX.JTX_USERS.FULL_NAME","aliases":"Job%20ID,Job%20Status,Assigned%20To","tables":"WMX.JTX_JOBS,WMX.JTX_STATUS,WMX.JTX_USERS","where":"JTX_STATUS.ID=JTX_JOBS.STATUS%20AND%20JTX_USERS.USERNAME=JTX_JOBS.ASSIGNED_TO%20AND%20JTX_JOBS.STATUS=7","containerId":"2"}&f=pjson

JSON Response Syntax

{ "queryId": "<queryId>" }

JSON Response Example

{ "queryId": 401 }