QueryTask for Feature Service

2222
4
Jump to solution
03-29-2016 03:13 PM
KarenRobine
Occasional Contributor II

I am wondering if there's a queryTask for an entire Feature Service (not just layers within a Feature Service)? I am trying to duplicate the functionality located at this site:  ArcGIS REST API   The main component is that I need to setup the layerDefs parameters.   I cannot see anything located in the ArcGIS JavaScript API for this, with the exception of executing an esriRequest.  Am I missing something?

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Karen,

  No you are seeing the same as me there is nothing to indicate the JS API supports querying the whole Feature Service.

View solution in original post

4 Replies
RobertScheitlin__GISP
MVP Emeritus

Karen,

  No you are seeing the same as me there is nothing to indicate the JS API supports querying the whole Feature Service.

BillDaigle
Occasional Contributor III

If the feature service has an accompanying map service, you could run an identify task on the map service and get results back for every layer. 

0 Kudos
YueWu1
by Esri Regular Contributor
Esri Regular Contributor

Hi Bill,

Yes, but you must list lout all layerIds in IdentifyParameters | API Reference | ArcGIS API for JavaScript

Here is a sample that shows how identify tasks run a maplayer with multiple layerIds Display identify results in popup | ArcGIS API for JavaScript


Hope this can help

0 Kudos
KarenRobine
Occasional Contributor II

Hello Bill and Yue:


I am not using the Feature Service for the purpose of performing an Identify. I am wishing to send a query directly to the Feature Service and have it query several of the layers within the Feature Service (each with unique where clauses), and provide back some results. The beauty of this method is that all of the work is done on the server-side, and does not require multiple "deferred" QueryTask requests to the server to capture the data I require. I realize that I could send these asynchronous requests to each layer individually to obtain my results, but this method is much slower then the intended request.


I would think something like this would be quite helpful in the API, no?

Karen

0 Kudos