FRAMES | NO FRAMES Description | Parameters | Examples | Response
Create User Query (Operation)
URL http://<users-url>/<username>/createQuery
Parent Resource User

Description

This operation is supported from 10.3.1 onwards.

Creates a user query.

Parameters

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

Values: html | json
user Required

Description: The user name of the person who makes the create query request. The user who has "ManageQuery" privilege can create their own personal queries.
properties Required

Description: A JSON object containing the user 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 user query container ID of the query. If no containerId is specified, the new query will be created in the "UserQuery" container as the parent container.

Syntax:

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

Example Usage

Example: URL for Andy Miller with user name "amiller" to create his own query named "ClosedJobs" in the "Workflow" service on sampleserver. The query will return all closed jobs with job status as "Closed". The query container ID is "2". Andy Miller has "ManageQuery" privilege.

http://sampleserver/arcgis/rest/services/Workflow/WMServer/community/users/amiller/createQuery?user=amiller&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 }