<?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: returnDistinctValues does not always work in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/returndistinctvalues-does-not-always-work/m-p/505815#M47010</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looking at the &lt;A href="https://developers.arcgis.com/javascript/jsapi/query-amd.html#returndistinctvalues"&gt;docs&lt;/A&gt;, you need to specify the field for distinctValues in the outFields parameter and need server 10.11 minimum. supportsAdvancedQueries of the service also needs to be true, but I think true is the default setting when a service is published.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does it work consistently when you perform the query via the REST HTML page of the sevice?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Dec 2014 21:16:23 GMT</pubDate>
    <dc:creator>ReneRubalcava</dc:creator>
    <dc:date>2014-12-22T21:16:23Z</dc:date>
    <item>
      <title>returnDistinctValues does not always work</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/returndistinctvalues-does-not-always-work/m-p/505814#M47009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var queryTask = new QueryTask(layer.layerObject.url + "?returnDistinctValues=true");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But sometimes this works and sometimes it does not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are there any server settings for each layer (featurelayer) that needs to be specified precisely to make the returnDistinctValues=true work?&lt;/P&gt;&lt;P&gt;Using v. 3.10.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Dec 2014 21:04:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/returndistinctvalues-does-not-always-work/m-p/505814#M47009</guid>
      <dc:creator>EdwardSohn2</dc:creator>
      <dc:date>2014-12-22T21:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: returnDistinctValues does not always work</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/returndistinctvalues-does-not-always-work/m-p/505815#M47010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looking at the &lt;A href="https://developers.arcgis.com/javascript/jsapi/query-amd.html#returndistinctvalues"&gt;docs&lt;/A&gt;, you need to specify the field for distinctValues in the outFields parameter and need server 10.11 minimum. supportsAdvancedQueries of the service also needs to be true, but I think true is the default setting when a service is published.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does it work consistently when you perform the query via the REST HTML page of the sevice?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Dec 2014 21:16:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/returndistinctvalues-does-not-always-work/m-p/505815#M47010</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2014-12-22T21:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: returnDistinctValues does not always work</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/returndistinctvalues-does-not-always-work/m-p/505816#M47011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Seems like the layers for which it does not work are feature collections and those for which it works are feature services... (at least for two of the layers for which it did not work...)&amp;nbsp; Do they really need to be feature services?&amp;nbsp; Is it possible to make it work for feature collections?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Dec 2014 21:32:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/returndistinctvalues-does-not-always-work/m-p/505816#M47011</guid>
      <dc:creator>EdwardSohn2</dc:creator>
      <dc:date>2014-12-22T21:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: returnDistinctValues does not always work</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/returndistinctvalues-does-not-always-work/m-p/505817#M47012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From the API help; when dealing with FeatureCollection based FeatureLayers: &lt;EM&gt;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.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;A href="https://developers.arcgis.com/javascript/jsapi/featurelayer-amd.html#featurelayer2" title="https://developers.arcgis.com/javascript/jsapi/featurelayer-amd.html#featurelayer2"&gt;FeatureLayer | API Reference | ArcGIS API for JavaScript&lt;/A&gt; &lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Dec 2014 21:41:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/returndistinctvalues-does-not-always-work/m-p/505817#M47012</guid>
      <dc:creator>JohnGrayson</dc:creator>
      <dc:date>2014-12-22T21:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: returnDistinctValues does not always work</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/returndistinctvalues-does-not-always-work/m-p/505818#M47013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The layers apparently are both feature services and they both have supportsAdvancedQueries set to true.&amp;nbsp; But the &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;returnDistinctValues=true &lt;/SPAN&gt;are still not working...&amp;nbsp; (and yes the field is being sent as outFields parameter in the queries)...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Dec 2014 23:28:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/returndistinctvalues-does-not-always-work/m-p/505818#M47013</guid>
      <dc:creator>EdwardSohn2</dc:creator>
      <dc:date>2014-12-30T23:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: returnDistinctValues does not always work</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/returndistinctvalues-does-not-always-work/m-p/505819#M47014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Edward, do you have a jsfiddle or jsbin showing the issue?&amp;nbsp; If not, do you have a rest url endpoint and query parameters that we can try it out?&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Dec 2014 00:44:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/returndistinctvalues-does-not-always-work/m-p/505819#M47014</guid>
      <dc:creator>JohnGrayson</dc:creator>
      <dc:date>2014-12-31T00:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: returnDistinctValues does not always work</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/returndistinctvalues-does-not-always-work/m-p/505820#M47015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh btw, the server url seem to be different:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Those that work are of type:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://utility.arcgis.com/usrsvcs/...?returnDistinctValues=true" rel="nofollow" target="_blank"&gt;https://utility.arcgis.com/usrsvcs/...?returnDistinctValues=true&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Those that don't work all seem to be of type:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://services2.arcgis.com/...?returnDistinctValues=true" rel="nofollow" target="_blank"&gt;https://services2.arcgis.com/...?returnDistinctValues=true&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;i.e. starting with &lt;A href="https://services2.arcgis.com/" title="https://services2.arcgis.com/"&gt;https://services2.arcgis.com/&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is one example which doesn't seem to work:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://services2.arcgis.com/OzJIHUWI4lRJCw0e/arcgis/rest/services/BusStop/FeatureServer/0?returnDistinctValues=true" rel="nofollow" target="_blank"&gt;https://services2.arcgis.com/OzJIHUWI4lRJCw0e/arcgis/rest/services/BusStop/FeatureServer/0?returnDistinctValues=true&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Dec 2014 03:44:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/returndistinctvalues-does-not-always-work/m-p/505820#M47015</guid>
      <dc:creator>EdwardSohn2</dc:creator>
      <dc:date>2014-12-31T03:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: returnDistinctValues does not always work</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/returndistinctvalues-does-not-always-work/m-p/505821#M47016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Edward,&lt;/P&gt;&lt;P&gt;  returnDistinctValues is a property on the JS API Query object, not a parameter of the url of the service, so please don't include it when creating the Query instance.  The services you mention are secure services so make sure you include a reference to esri/IdentityManager so the appropriate credentials are obtained and used by the JS API before you make the request.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would help if you shared some of the JS code so we can figure out what is going on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Dec 2014 05:29:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/returndistinctvalues-does-not-always-work/m-p/505821#M47016</guid>
      <dc:creator>JohnGrayson</dc:creator>
      <dc:date>2014-12-31T05:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: returnDistinctValues does not always work</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/returndistinctvalues-does-not-always-work/m-p/505822#M47017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Currently we are using 3.10. returnDistinctValues is not defined until 3.11.&amp;nbsp; Sending as query parameter does work... but only for utility.arcgis.com/usrsvcs...&lt;/P&gt;&lt;P&gt;doesn't work for services2.arcgis.com urls...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried upgrading to 3.11 and using&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var queryTask = new QueryTask(layer.layerObject.url);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var esriQuery = new Query();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esriQuery.returnDistinctValues = true;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esriQuery.outFields = [attribute];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esriQuery.where = typeof layer.layerObject.defaultDefinitionExpression === "undefined" || layer.layerObject.defaultDefinitionExpression === null ? "1=1" : layer.layerObject.defaultDefinitionExpression;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Got same results:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Worked for utility.arcgis.com/usrsvcs...&lt;/P&gt;&lt;P&gt;doesn't work for services2.arcgis.com urls...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Dec 2014 17:51:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/returndistinctvalues-does-not-always-work/m-p/505822#M47017</guid>
      <dc:creator>EdwardSohn2</dc:creator>
      <dc:date>2014-12-31T17:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: returnDistinctValues does not always work</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/returndistinctvalues-does-not-always-work/m-p/505823#M47018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are using 3.10, you'll need to hack it a little bit using &lt;EM&gt;setRequestPreCallback&lt;/EM&gt; as described in &lt;A _jive_internal="true" href="https://community.esri.com/message/399182#399182"&gt;this thread&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Dec 2014 18:05:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/returndistinctvalues-does-not-always-work/m-p/505823#M47018</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2014-12-31T18:05:24Z</dc:date>
    </item>
    <item>
      <title>Re: returnDistinctValues does not always work</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/returndistinctvalues-does-not-always-work/m-p/505824#M47019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am able to upgrade to 3.11/3.12, and it &lt;SPAN style="line-height: 1.5;"&gt;works, but for some of those urls does not work...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Worked for utility.arcgis.com/usrsvcs...&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;doesn't work for services2.arcgis.com urls...&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;API doc says &lt;SPAN style="color: #4d4d4d; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif;"&gt;ArcGIS Server 10.1 Service Pack 1 required.&amp;nbsp; Is it poss that &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;services2.arcgis.com fails this requirement..?&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;SPAN style="color: #4d4d4d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Just wondering...&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Dec 2014 18:50:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/returndistinctvalues-does-not-always-work/m-p/505824#M47019</guid>
      <dc:creator>EdwardSohn2</dc:creator>
      <dc:date>2014-12-31T18:50:43Z</dc:date>
    </item>
  </channel>
</rss>

