is there a way to order the returned results of a query task?


query.where = "COD > 0";

works fine, but this:

query.where = "COD > 0 order by COD";


dojo.io.script error undefined

Please note that our server has standardized queries enabled and we cannot change that.

  • 3
    The WHERE clause parameter is ONLY a WHERE clause. You can specify a data source based on an ORDER BY (view or Query Layer)
    – Vince
    Jun 23 '15 at 23:45

Vince is right.

in the jsapi this is expressed as query.orderByFields https://developers.arcgis.com/javascript/jsapi/query-amd.html#orderbyfields

in REST itself, the parameter is the same: http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Query_Feature_Service_Layer/02r3000000r1000000/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.