Please enable JavaScript to view this site.

Version:

Navigation: Activities > Activity Reference

Query Layer Activity

Prev Top Next More

Description

The Query Layer activity executes a query operation on a layer or table resource of a map service exposed by the ArcGIS Server REST API.

Usage

You may need to query an ArcGIS Map Service. You could use the Query Layer activity to perform searches based on user input using the Display Form activity.

Inputs

Url

Optional

Type: String

The URL of the ArcGIS layer or table to query. Either Url or Layer is required.

For example, http://server/arcgis/rest/services/<serviceName>/MapServer/<layerIdOrTableId>.

Layer

Optional

Type: esri.Layer (3.x, 4.x)*

The ArcGIS feature layer or table. Either Url or Layer is required.

Where

Optional

Type: String

A where clause of the query.

Any legal SQL where clause operating on the fields in the layer or table is allowed. For example, POP2000 > 35000.

Geometry

Optional

Type: esri.Geometry (3.x, 4.x)*

The geometry to apply to the spatial filter when querying a layer.

Return Geometry

Optional

Type: Boolean

If true, each feature in the result feature set includes the geometry.

Set to false (default) if you do not plan to include highlighted features on a map because the geometry takes up a significant portion of the response.

Return Distinct Values

Optional

Type: Boolean

If true, the result will contain distinct values based on the fields specified in the Output Fields property.

Only applies if the supportsAdvancedQueries property of the layer or table is true.

Return Z

Optional

Type:Boolean

If true, z-values are included in the results if the features have z-values. Otherwise, z-values are not returned. The default is false. This parameter only applies if Return Geometry is true and at least one of the layer's hasZ properties is true.

Return M

Optional

Type:Boolean

If true, m-values are included in the results if the features have m-values. Otherwise, m-values are not returned. The default is false. This parameter only applies if Return Geometry is true and at least one of the layer's hasM properties is true.

Output Spatial Reference

Optional

Type: Number | String | esri.SpatialReference (3.x, 4.x)*

The spatial reference for the returned geometry.

If not specified, the geometry is returned in the spatial reference of the service being queried.

Output Fields

Optional

Type: String | String[]

The fields to include in the result feature set.

By default only the display field of the service is included.

To return all fields, set Output Fields to the wildcard '*'.

Order By Fields

Optional

Type: String | String[]

The sorting order for the results.

Specify ASC (ascending) or DESC (descending) after the field name to control the order. The default order is ASC.

Order By Fields is only supported on dynamic layers where supportsAdvancedQueries is true.

Geodatabase Version

Optional

Type: String

The geodatabase version on which to perform the query.

This property applies to feature services.

Distance

Optional

Type: Number

Distance to buffer the input geometry when querying a layer.

Query results will include features within the distance specified of the query geometry.

Valid only for feature services hosted on ArcGIS Online.

Geometry Precision

Optional

Type: Number

The number of decimal places for the geometries returned by the query operation.

Group By Fields For Statistics

Optional

Type: String | String[]

One or more field names that will be used to group the statistics.

This is only valid when Out Statistics has been defined.

Max Allowable Offset

Optional

Type: Number

The maximum allowable offset to be used for generalizing geometries returned by a layer query.

The offset is in the units of Output Spatial Reference.

If Output Spatial Reference is not defined, the spatial reference of the service is used.

Multipatch Option

Optional

Type: String

Supports querying feature services whose data source is a multipatch featureclass.

Known values: xyFootprint.

Count

Optional

Type: Number

Number of features or records to retrieve.

Should be used in conjunction with query.start.

Use this to implement paging and retrieve "pages" of results when querying.

If not provided, but an instance of Query has a "start" property, Count defaults to 10.

Valid only for feature services hosted on ArcGIS Online.

Ids

Optional

Type: Number | Number[]

An object ID or an array of object IDs to query for.

Out Statistics

Optional

Type: esri.StatisticDefinition (3.x, 4.x)* | esri.StatisticDefinition[] (3.x, 4.x)*

The definitions for one or more field-based statistics to be calculated.

Only supported on layers and tables where supportsStatistics is set to true.

If Out Statistics is specified, the only other properties that will be used are Group By Fields For Statistics, Order By Fields, Text, Time Extent, and Where.

Pixel Size

Optional

Type: esri.Symbol (3.x, 4.x)*

Specify the pixel level to be identified on the X and Y axis.

Defaults to the base resolution of the dataset if not specified.

Applicable only to Image Service layers.

Quantization Parameters

Optional

Type: esri.QueryQuantizationParameters (3.x, 4.x)*

Used to project the geometry onto a virtual grid, likely representing pixels on the screen.

Valid only for services hosted on ArcGIS Online.

Source

Optional

Type: esri.LayerDataSource (3.x)* | esri.LayerMapSource (3.x)* | DynamicDataLayer (4.x)* | DynamicMapLayer (4.x)*

The layer source used with a dynamic layer. If used, the Url input must also be specified and reference a dynamic layer.

For example, http://server/arcgis/rest/services/<serviceName>/MapServer/dynamicLayer.

Spatial Relationship

Optional

Type: "contains" | "crosses" | "intersects" | "envelope-intersects" | "index-intersects" | "overlaps" | "touches" | "within" | String

The spatial relationship to be applied on the input geometry when querying a layer.

The default is "intersects".

Dimensionally Extended 9 Intersection Model (DE-9IM) matrix relation strings are also supported.

Start

Optional

Type: Number

Zero-based index indicating where to begin retrieving features or records.

Should be used in conjunction with query.num.

Use this to implement paging and retrieve "pages" of results when querying.

Features are sorted ascending by object ID by default.

Valid only for feature services hosted on ArcGIS Online.

Text

Optional

Type: String

Shorthand for a literal search text on the display field, equivalent to: Where <displayField> like '%%'.

The text is case sensitive.

This property is ignored if Where is specified.

You can determine what the display field is for a layer or table using the ArcGIS Services Directory.

Time Extent

Optional

Type: any

The time instant or the time extent to query.

* VertiGIS Studio Workflow uses different versions of Esri's ArcGIS API for JavaScript depending on the type of host application. See Underlying Technologies for information.

Outputs

feature

Type: esri.Graphic (3.x, 4.x)*

The first feature or record of the result feature set.

features

Type: esri.Graphic[] (3.x, 4.x)*

The features or records of the result feature set.

results

Type: esri.FeatureSet (3.x, 4.x)*

The feature set returned by the query operation.

* VertiGIS Studio Workflow uses different versions of Esri's ArcGIS API for JavaScript depending on the type of host application. See Underlying Technologies for information.

Properties

For information about the ID, Display Name, and Description properties, see Properties Common to all Activities.

Connectivity Requirements

For this activity to work when the device has intermittent connectivity to the network, the activity must run in the following application:

VertiGIS Studio Mobile

The app must have a map area that includes the layer or table.

You must use the Layer input to specify the layer or table, not the Url input.

Version Information

Supported from: Geocortex Viewer for HTML5 2.9, ArcGIS Web AppBuilder 2.4.

See also...

Get a Feature Set by Querying a Map Service

Find a Particular Feature Returned by a Query

Example 2 - Verbose Log for a Query Layer Activity

© 2024 VertiGIS North America Ltd. All Rights Reserved. | Privacy Center | Imprint
Documentation Version 5.42 (220a4365)