Select to view content in your preferred language

selectFeatures - query contains one or more unsupported parameters

3984
8
07-25-2012 03:23 AM
RahulMetangale1
Occasional Contributor II
Hi All,

Issue: Getting  an error, "selectFeatures - query contains one or more unsupported parameters", while passing a select query to a feature layer created from a feature set at run time.

Description:
-I am creating a feature layer at run time using a features returned by some Java web service.
-I can see the features on the map.
-However when I pass a selectFeatures query to this layer I get an error mentioned above.
-Here is the where clause that I am using for query:
userName = 'BILL' OR firstName = 'BILL'

Any help is greatly appreciated.

-Rahul
0 Kudos
8 Replies
ReneRubalcava
Frequent Contributor II
Query debugs like this are best tested at the Query URL of your MapService
Something like
http://<servername>/ArcGIS/rest/services/<servicename>/MapServer/<layerid>/query
It could be something like wrapping () around portion of the query.
0 Kudos
RahulMetangale1
Occasional Contributor II
Thank you your response.

The feature layer is generated at runtime so it does not have a URL like you mentioned. As per the API documentation:
http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi_start.htm#jsapi/featurelayer.htm#selec...
Selects features from the FeatureLayer. Layer properties like layer definition and time definition are honored. The selection method defines how query results are passed to the selection. The feature layer will highlight the current selection if a selection symbol has been defined. Whenever possible, the feature layer will perform the query operation on the client (browser).

Not sure what is going wrong.
0 Kudos
RahulMetangale1
Occasional Contributor II
Here is the sample reproducible test case:
http://jsfiddle.net/rahulm/nJxyW/
0 Kudos
JohnGrayson
Esri Regular Contributor
Rahul, if you're creating the FeatureLayer not from a url as you mention but from a featureCollectionObject, then you should look at the restrictions associated with this FeatureLayer constructor (link)

* Does not support queries that need to be performed on the server, e.g. queries with a where clause or non-extent based spatial queries.
0 Kudos
RahulMetangale1
Occasional Contributor II
Thank you John! That helps!
0 Kudos
SavanThongvanh
New Contributor
sorry to hijack but I have the same problem.  If this is true what is the right, aka feasible, way to select features in a feature layer?
0 Kudos
RahulMetangale1
Occasional Contributor II
Savan,

We created web services based on ESRI rest specification now slection query work as expected.
0 Kudos
Jay_Gregory
Regular Contributor
I have also created a FeatureLayer from a featureCollectionObject.  I am trying to perform an extent-based spatial query (which according to the documentation is supported), but I keep getting the "FeatureLayer::selectFeatures - query contains one or more unsupported parameters" error.  My question is: what do I need to do to create an "extent-based" spatial query?  Do I have to change the spatialRelationship attribute of the query to a specific string?  the geometry attribute is already set to an extent. 

Thanks!

Rahul, if you're creating the FeatureLayer not from a url as you mention but from a featureCollectionObject, then you should look at the restrictions associated with this FeatureLayer constructor (link)

* Does not support queries that need to be performed on the server, e.g. queries with a where clause or non-extent based spatial queries.
0 Kudos