<?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: get distinct attribute values from featureservice in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/get-distinct-attribute-values-from-featureservice/m-p/494475#M11347</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Andrezj,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you using server 10.1 as there was an extra attribute added to the query function with service pack 1 that allows you to return unique values.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;returnDistinctValues //This option was added at 10.1 SP1 &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Description: If true then returns distinct values based on the fields specified in outFields. This parameter applies only if supportsAdvancedQueries property of the layer is true.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Syntax: returnDistinctValues=&amp;lt;true | false&amp;gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Example: returnDistinctValues=true&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;See:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/rest/apiref/"&gt;http://resources.arcgis.com/en/help/rest/apiref/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anthony&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 16 Sep 2013 11:09:23 GMT</pubDate>
    <dc:creator>AnthonyGiles</dc:creator>
    <dc:date>2013-09-16T11:09:23Z</dc:date>
    <item>
      <title>get distinct attribute values from featureservice</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/get-distinct-attribute-values-from-featureservice/m-p/494474#M11346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm looking for solution how can I get distinct attribute values from featureservice (types of hikingtrails). Later I want to put them in my combobox in flex webapplication. What is the best solution to get values? Is in API for Flex sometnig like SearchCursor I use in python?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Sep 2013 12:19:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/get-distinct-attribute-values-from-featureservice/m-p/494474#M11346</guid>
      <dc:creator>AndrzejMilosz</dc:creator>
      <dc:date>2013-09-15T12:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: get distinct attribute values from featureservice</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/get-distinct-attribute-values-from-featureservice/m-p/494475#M11347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Andrezj,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you using server 10.1 as there was an extra attribute added to the query function with service pack 1 that allows you to return unique values.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;returnDistinctValues //This option was added at 10.1 SP1 &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Description: If true then returns distinct values based on the fields specified in outFields. This parameter applies only if supportsAdvancedQueries property of the layer is true.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Syntax: returnDistinctValues=&amp;lt;true | false&amp;gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Example: returnDistinctValues=true&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;See:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/rest/apiref/"&gt;http://resources.arcgis.com/en/help/rest/apiref/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anthony&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Sep 2013 11:09:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/get-distinct-attribute-values-from-featureservice/m-p/494475#M11347</guid>
      <dc:creator>AnthonyGiles</dc:creator>
      <dc:date>2013-09-16T11:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: get distinct attribute values from featureservice</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/get-distinct-attribute-values-from-featureservice/m-p/494476#M11348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Check this out....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;mx:Application
 xmlns:mx="http://www.adobe.com/2006/mxml"
 xmlns:esri="http://www.esri.com/2008/ags"
 pageTitle="Query, then zoom to results"
 styleName="plain"
 initialize="init()"&amp;gt;
 
 &amp;lt;mx:Script&amp;gt;
&amp;nbsp; &amp;lt;![CDATA[
&amp;nbsp;&amp;nbsp; import com.esri.ags.Graphic;
&amp;nbsp;&amp;nbsp; import com.esri.ags.geometry.Polygon;
&amp;nbsp;&amp;nbsp; import com.esri.ags.FeatureSet;
&amp;nbsp;&amp;nbsp; import mx.controls.Alert;
&amp;nbsp;&amp;nbsp; import mx.rpc.AsyncResponder;
&amp;nbsp;&amp;nbsp; import mx.collections.ArrayCollection;
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; [Bindable]
&amp;nbsp;&amp;nbsp; public var myAC:ArrayCollection = new ArrayCollection();
&amp;nbsp;&amp;nbsp; [Bindable]
&amp;nbsp;&amp;nbsp; public var myQueryString:String = "%";
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; private function init():void
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; queryTask.execute(initquery, new AsyncResponder(onResult, onFault));
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; function onResult(featureSet:FeatureSet, token:Object = null):void
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for each (var myGraphic1:Graphic in featureSet.features)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myAC.addItem(myGraphic1.attributes.PROJECTID);
&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;&amp;nbsp; function onFault(info:Object, token:Object = null):void
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Alert.show(info.toString());
&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;gt;
 &amp;lt;/mx:Script&amp;gt;
 
 &amp;lt;!-- Start Declarations --&amp;gt;
 &amp;lt;!-- Symbol for Query Result as Polygon --&amp;gt;
 &amp;lt;esri:SimpleFillSymbol id="sfs" alpha="0.7" color="0xFF0000"/&amp;gt;
 
 &amp;lt;!-- Layer with US States --&amp;gt;
 &amp;lt;esri:QueryTask id="queryTask"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url="http://......"/&amp;gt;
 
 &amp;lt;esri:Query id="initquery" text="{myQueryString}"
&amp;nbsp;&amp;nbsp;&amp;nbsp; returnGeometry="false" outSpatialReference="{map.spatialReference}"&amp;gt;
&amp;nbsp; &amp;lt;esri:outFields&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;mx:String&amp;gt;*&amp;lt;/mx:String&amp;gt;
&amp;nbsp; &amp;lt;/esri:outFields&amp;gt;
 &amp;lt;/esri:Query&amp;gt;
 
 
 
 &amp;lt;mx:HBox width="100%" height="40" backgroundColor="0xDDDDFF" paddingTop="10" horizontalAlign="center"&amp;gt;
&amp;nbsp; &amp;lt;mx:Label text="Project ID"/&amp;gt;
&amp;nbsp; &amp;lt;mx:ComboBox id="QueryComboBox" dataProvider="{myAC}"&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/mx:ComboBox&amp;gt;
&amp;nbsp; 
 &amp;lt;/mx:HBox&amp;gt;
 
 
 &amp;lt;mx:VDividedBox height="100%" width="100%"&amp;gt;
&amp;nbsp; 
&amp;nbsp; &amp;lt;esri:Map id="map"&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:extent&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:Extent xmin="-126" ymin="24" xmax="-67" ymax="50"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:SpatialReference wkid="4326"/&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/esri:Extent&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;/esri:extent&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:ArcGISDynamicMapServiceLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp; url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer"/&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:GraphicsLayer id="myGraphicsLayer" symbol="{sfs}"/&amp;gt;
&amp;nbsp; &amp;lt;/esri:Map&amp;gt;
&amp;nbsp; 
 &amp;lt;/mx:VDividedBox&amp;gt;
&amp;lt;/mx:Application&amp;gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:46:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/get-distinct-attribute-values-from-featureservice/m-p/494476#M11348</guid>
      <dc:creator>KomanDiabate</dc:creator>
      <dc:date>2021-12-11T21:46:07Z</dc:date>
    </item>
  </channel>
</rss>

