<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Why isn't &amp;amp;quot;returnDistinctValues&amp;amp;quot; an option for the &amp;amp;quot;Query&amp;amp;quot; object in the JS API? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-isn-t-amp-quot-returndistinctvalues-amp-quot/m-p/272642#M25156</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kudos to John and Andrew for the workarounds. A few follow-up notes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Appending the parameter directly to the QueryTask URL probably means that parameter is set for the life of the QueryTask.&amp;nbsp; If you want to be able to set the parameter on a query-by-query basis, use John's workaround (&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fdevelopers.arcgis.com%2Fen%2Fjavascript%2Fjsapi%2Fnamespace_esri-amd.html%23setRequestPreCallback" rel="nofollow" style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #287433;" target="_blank"&gt;esriRequset.setRequestPreCallback()&lt;/A&gt;​).&lt;/LI&gt;&lt;LI&gt;The workarounds given in this thread should also work for other Query properties, such as returnM and returnZ.&amp;nbsp; The lack of these properties on Query is noted in &lt;SPAN style="color: #000000; font-family: 'Trebuchet MS', Verdana, Arial, sans-serif; font-size: medium;"&gt;NIM091578. &lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Sep 2015 13:29:19 GMT</pubDate>
    <dc:creator>JasonHine</dc:creator>
    <dc:date>2015-09-18T13:29:19Z</dc:date>
    <item>
      <title>Why isn't &amp;quot;returnDistinctValues&amp;quot; an option for the &amp;quot;Query&amp;quot; object in the JS API?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-isn-t-amp-quot-returndistinctvalues-amp-quot/m-p/272637#M25151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I was just looking over the Esri JS API documentation and the Esri REST API documentation at query operations.&amp;nbsp; I noticed that the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;query&lt;/SPAN&gt;&lt;SPAN&gt; REST endpoint is called by the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;FeatureLayer.queryFeatures&lt;/SPAN&gt;&lt;SPAN&gt; function.&amp;nbsp; The &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;query&lt;/SPAN&gt;&lt;SPAN&gt; REST endpoint has an option for &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;returnDistinctValues&lt;/SPAN&gt;&lt;SPAN&gt; to get a list of unique values in a field.&amp;nbsp; Why isn't this an option for the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;Query&lt;/SPAN&gt;&lt;SPAN&gt; object in the JS API.&amp;nbsp; It's always a lot of trouble to have to sift through the results of a query to get the unique values and it's even worse when there are more values than are returned by a single query.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Oct 2013 14:47:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-isn-t-amp-quot-returndistinctvalues-amp-quot/m-p/272637#M25151</guid>
      <dc:creator>BrianBeck</dc:creator>
      <dc:date>2013-10-29T14:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't "returnDistinctValues" an option for the "Query" object in the JS API?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-isn-t-amp-quot-returndistinctvalues-amp-quot/m-p/272638#M25152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;that particular query parameter has not yet been added to our JavaScript API.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[NIM091580: Add 'returnDistinctValues' property to the esri.tasks.Query class.]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;until it is included, you might consider using &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/en/javascript/jsapi/namespace_esri-amd.html#setRequestPreCallback"&gt;esriRequset.setRequestPreCallback()&lt;/A&gt;&lt;SPAN&gt; to catch the request immediately before it is issued and modify it as needed.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 16:20:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-isn-t-amp-quot-returndistinctvalues-amp-quot/m-p/272638#M25152</guid>
      <dc:creator>JohnGravois</dc:creator>
      <dc:date>2013-10-30T16:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't "returnDistinctValues" an option for the "Query" object in the JS API?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-isn-t-amp-quot-returndistinctvalues-amp-quot/m-p/272639#M25153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I was just looking over the Esri JS API documentation and the Esri REST API documentation at query operations.&amp;nbsp; I noticed that the &lt;SPAN style="font-style:italic;"&gt;query&lt;/SPAN&gt; REST endpoint is called by the &lt;SPAN style="font-style:italic;"&gt;FeatureLayer.queryFeatures&lt;/SPAN&gt; function.&amp;nbsp; The &lt;SPAN style="font-style:italic;"&gt;query&lt;/SPAN&gt; REST endpoint has an option for &lt;SPAN style="font-style:italic;"&gt;returnDistinctValues&lt;/SPAN&gt; to get a list of unique values in a field.&amp;nbsp; Why isn't this an option for the &lt;SPAN style="font-style:italic;"&gt;Query&lt;/SPAN&gt; object in the JS API.&amp;nbsp; It's always a lot of trouble to have to sift through the results of a query to get the unique values and it's even worse when there are more values than are returned by a single query.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe I am missing something, but&amp;nbsp; in 3.8 its still not in there... &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I was able to work around it by adding the REST parameter in myself..&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sample&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
var queryTask = new QueryTask(dataURL + "?returnDistinctValues=true"); 
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Drew&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:18:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-isn-t-amp-quot-returndistinctvalues-amp-quot/m-p/272639#M25153</guid>
      <dc:creator>Drew</dc:creator>
      <dc:date>2021-12-11T13:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't "returnDistinctValues" an option for the "Query" object in the JS API?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-isn-t-amp-quot-returndistinctvalues-amp-quot/m-p/272640#M25154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Very thanks cgishack!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It´s worked!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 12:25:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-isn-t-amp-quot-returndistinctvalues-amp-quot/m-p/272640#M25154</guid>
      <dc:creator>AlexandreLuquetta</dc:creator>
      <dc:date>2014-05-29T12:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't "returnDistinctValues" an option for the "Query" object in the JS API?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-isn-t-amp-quot-returndistinctvalues-amp-quot/m-p/272641#M25155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;that particular query parameter has not yet been added to our JavaScript API.&lt;BR /&gt;&lt;BR /&gt;[NIM091580: Add 'returnDistinctValues' property to the esri.tasks.Query class.]&lt;BR /&gt;&lt;BR /&gt;until it is included, you might consider using &lt;A href="https://developers.arcgis.com/en/javascript/jsapi/namespace_esri-amd.html#setRequestPreCallback"&gt;esriRequset.setRequestPreCallback()&lt;/A&gt; to catch the request immediately before it is issued and modify it as needed.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;As of 3.9 This is still not in the JS API, the workaround does work it would be cleaner for it to be part of the API. The reported BUG number NIM091580 cannot be found inthe bug base either.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2014 16:36:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-isn-t-amp-quot-returndistinctvalues-amp-quot/m-p/272641#M25155</guid>
      <dc:creator>PremRadhakrishnan</dc:creator>
      <dc:date>2014-06-17T16:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't &amp;quot;returnDistinctValues&amp;quot; an option for the &amp;quot;Query&amp;quot; object in the JS API?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-isn-t-amp-quot-returndistinctvalues-amp-quot/m-p/272642#M25156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kudos to John and Andrew for the workarounds. A few follow-up notes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Appending the parameter directly to the QueryTask URL probably means that parameter is set for the life of the QueryTask.&amp;nbsp; If you want to be able to set the parameter on a query-by-query basis, use John's workaround (&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fdevelopers.arcgis.com%2Fen%2Fjavascript%2Fjsapi%2Fnamespace_esri-amd.html%23setRequestPreCallback" rel="nofollow" style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #287433;" target="_blank"&gt;esriRequset.setRequestPreCallback()&lt;/A&gt;​).&lt;/LI&gt;&lt;LI&gt;The workarounds given in this thread should also work for other Query properties, such as returnM and returnZ.&amp;nbsp; The lack of these properties on Query is noted in &lt;SPAN style="color: #000000; font-family: 'Trebuchet MS', Verdana, Arial, sans-serif; font-size: medium;"&gt;NIM091578. &lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Sep 2015 13:29:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-isn-t-amp-quot-returndistinctvalues-amp-quot/m-p/272642#M25156</guid>
      <dc:creator>JasonHine</dc:creator>
      <dc:date>2015-09-18T13:29:19Z</dc:date>
    </item>
  </channel>
</rss>

