<?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 ArcGIS Rest API returnDistinctValues with multiple output fields in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/arcgis-rest-api-returndistinctvalues-with-multiple/m-p/1185448#M4186</link>
    <description>&lt;P&gt;We are running ArcGIS Enterprise 10.9 and have created a SBDS using the Geoevent Server. When trying to query the layers of the associated Feature Services for distinct records using multiple output fields, we get the following error message (see screenshot in addition):&lt;/P&gt;&lt;P&gt;&lt;EM&gt;"Return distinct values query is not supported for multiple fields on Elasticsearch, returnGeometry must be false."&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;However, the documentation of the ArcGIS REST API on &lt;FONT size="4"&gt;Query (Feature Service/Layer) &lt;/FONT&gt;states:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;EM&gt;&lt;SPAN class=""&gt;returnDistinctValues&lt;/SPAN&gt;&lt;/EM&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;EM&gt;If &lt;SPAN class=""&gt;true&lt;/SPAN&gt;, it returns distinct values based on the fields specified in &lt;SPAN class=""&gt;outFields&lt;/SPAN&gt;. This parameter applies only if the &lt;SPAN class=""&gt;supportsAdvancedQueries&lt;/SPAN&gt; property of the layer is &lt;SPAN class=""&gt;true&lt;/SPAN&gt;. This parameter can be used with &lt;SPAN class=""&gt;returnCountOnly&lt;/SPAN&gt; to return the count of distinct values of subfields.&lt;/EM&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The returnGeoemetry&amp;nbsp; option was set to "false", and the &lt;EM&gt;&lt;SPAN class=""&gt;supportsAdvancedQueries&lt;/SPAN&gt;&lt;/EM&gt; of the FeatureService/layer is "true". From this I would assume that it should be possible to return Distinct Combinations of fields from the feature Service. Am I something missing here, or is this a mistake in the documentation?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bildschirmfoto vom 2022-06-23 14-42-34.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/44131i1D5559630209E55F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bildschirmfoto vom 2022-06-23 14-42-34.png" alt="Bildschirmfoto vom 2022-06-23 14-42-34.png" /&gt;&lt;/span&gt;&lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Jun 2022 11:40:06 GMT</pubDate>
    <dc:creator>TimLeefmann</dc:creator>
    <dc:date>2022-06-24T11:40:06Z</dc:date>
    <item>
      <title>ArcGIS Rest API returnDistinctValues with multiple output fields</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/arcgis-rest-api-returndistinctvalues-with-multiple/m-p/1185448#M4186</link>
      <description>&lt;P&gt;We are running ArcGIS Enterprise 10.9 and have created a SBDS using the Geoevent Server. When trying to query the layers of the associated Feature Services for distinct records using multiple output fields, we get the following error message (see screenshot in addition):&lt;/P&gt;&lt;P&gt;&lt;EM&gt;"Return distinct values query is not supported for multiple fields on Elasticsearch, returnGeometry must be false."&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;However, the documentation of the ArcGIS REST API on &lt;FONT size="4"&gt;Query (Feature Service/Layer) &lt;/FONT&gt;states:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;EM&gt;&lt;SPAN class=""&gt;returnDistinctValues&lt;/SPAN&gt;&lt;/EM&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;EM&gt;If &lt;SPAN class=""&gt;true&lt;/SPAN&gt;, it returns distinct values based on the fields specified in &lt;SPAN class=""&gt;outFields&lt;/SPAN&gt;. This parameter applies only if the &lt;SPAN class=""&gt;supportsAdvancedQueries&lt;/SPAN&gt; property of the layer is &lt;SPAN class=""&gt;true&lt;/SPAN&gt;. This parameter can be used with &lt;SPAN class=""&gt;returnCountOnly&lt;/SPAN&gt; to return the count of distinct values of subfields.&lt;/EM&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The returnGeoemetry&amp;nbsp; option was set to "false", and the &lt;EM&gt;&lt;SPAN class=""&gt;supportsAdvancedQueries&lt;/SPAN&gt;&lt;/EM&gt; of the FeatureService/layer is "true". From this I would assume that it should be possible to return Distinct Combinations of fields from the feature Service. Am I something missing here, or is this a mistake in the documentation?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bildschirmfoto vom 2022-06-23 14-42-34.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/44131i1D5559630209E55F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bildschirmfoto vom 2022-06-23 14-42-34.png" alt="Bildschirmfoto vom 2022-06-23 14-42-34.png" /&gt;&lt;/span&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2022 11:40:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/arcgis-rest-api-returndistinctvalues-with-multiple/m-p/1185448#M4186</guid>
      <dc:creator>TimLeefmann</dc:creator>
      <dc:date>2022-06-24T11:40:06Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Rest API returnDistinctValues with multiple output fields</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/arcgis-rest-api-returndistinctvalues-with-multiple/m-p/1186521#M4190</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/25473"&gt;@TimLeefmann&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;This may not be the solution, but have you tried to set ReturnCountOnly to True and see if the query returns the same error or not? Maybe you can also consider using only one field in the outfields and check the functionality first. If the query gives the result, then you can try adding more fields.&lt;/P&gt;&lt;P&gt;Please keep me updated.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jun 2022 17:11:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/arcgis-rest-api-returndistinctvalues-with-multiple/m-p/1186521#M4190</guid>
      <dc:creator>OsamaOthman</dc:creator>
      <dc:date>2022-06-26T17:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Rest API returnDistinctValues with multiple output fields</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/arcgis-rest-api-returndistinctvalues-with-multiple/m-p/1188275#M4201</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/535901"&gt;@OsamaOthman&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Yes I already tried that (ReturnCountOnly=True + Multiple Output Fields) and it works. But this is not what I wanted, as I need the actual distinct combinations of field values and not just the count of distinct combinations. If you set ReturnCountOnly=False + Multiple Output Fields the query will throw you the respective error. The same is true for trying to use GroupBy with multiple fields.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2022 13:50:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/arcgis-rest-api-returndistinctvalues-with-multiple/m-p/1188275#M4201</guid>
      <dc:creator>TimLeefmann</dc:creator>
      <dc:date>2022-06-30T13:50:18Z</dc:date>
    </item>
  </channel>
</rss>

