returnDistinctValues

2385
2
08-14-2014 12:18 PM
RobertScheitlin__GISP
MVP Emeritus

It seem crazy to me that the JavaScript API does not support this function that has been available in the REST endpoint of ArcGIS Server since 10.1... I have seen the workarounds for this but WHY is NIM091580 not added to the API yet?

derek swingleyDerek SwingleyKelly Hutchins

Is there something major that us end users are unaware of that id holding this up?

0 Kudos
2 Replies
KellyHutchins
Esri Frequent Contributor

Robert,

This was an oversight. We've added it to our list of items to address for the next release of the api (version 3.11).

Kelly

0 Kudos
KellyHutchins
Esri Frequent Contributor

A workaround for this issue until its added to the api would be to use setRequestPreCallback to append returnDistinctValues to the query. Here's an example of how that would look:

        esriRequest.setRequestPreCallback(function(ioArgs){

 

          if(ioArgs.url === "http://sampleserver5.arcgisonline.com/arcgis/rest/services/Census/MapServer/2/query"){

            ioArgs.content.returnDistinctValues = true;

          }

          return ioArgs;

        });