<?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: Populate DataGrid with FeatureLayer Attributes in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-datagrid-with-featurelayer-attributes/m-p/51592#M1218</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks also to Nathan and Rene for the insight and resources!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Doug&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Jul 2010 16:00:05 GMT</pubDate>
    <dc:creator>DouglasZedler</dc:creator>
    <dc:date>2010-07-29T16:00:05Z</dc:date>
    <item>
      <title>Populate DataGrid with FeatureLayer Attributes</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-datagrid-with-featurelayer-attributes/m-p/51583#M1209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How do you populate a DataGrid with the attributes of features in a FeatureLayer?&amp;nbsp; I've searched high and low and can't find the answer to this question, which is frustrating because it seems so fundamental.&amp;nbsp; Apparently, you can set the dataProvider property of the DataGrid to the attributes property of a FeatureSet object.&amp;nbsp; However, I can't get a reference to a FeatureSet object containing all the features in a FeatureLayer.&amp;nbsp; I've tried using the featureCollection property of the FeatureLayer object, but that is always null.&amp;nbsp; I've seen ways to do it using queries and selections, but I want to put the attributes of all the features from the FeatureLayer in the DataGrid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Doug&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jul 2010 17:29:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-datagrid-with-featurelayer-attributes/m-p/51583#M1209</guid>
      <dc:creator>DouglasZedler</dc:creator>
      <dc:date>2010-07-27T17:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: Populate DataGrid with FeatureLayer Attributes</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-datagrid-with-featurelayer-attributes/m-p/51584#M1210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Doug,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I wish I could answer your question!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am having a similar issue populating a Data Grid with Attributes from an Identify Task applied to a Dynamic Map Service. I've created a custom Info Renderer that contains a Data Grid. I'd like the Data Grid to display "Key" and "Value" columns populated by the identify results contained in data.attributes (exactly as they do in the default renderer). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any advice from the community would be immensely appreciated!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Amy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jul 2010 17:54:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-datagrid-with-featurelayer-attributes/m-p/51584#M1210</guid>
      <dc:creator>AmySmith</dc:creator>
      <dc:date>2010-07-27T17:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: Populate DataGrid with FeatureLayer Attributes</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-datagrid-with-featurelayer-attributes/m-p/51585#M1211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm still not 100% clear on FeatureLayers purpose. It would seem looking at examples it's usefulness is really for editing and time-aware data. I'm sure they've covered it in more detail somewhere, but I may have missed it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If you review this sample, you'll see a quick note about FeatureCollection for FeatureLayer that states you should initialize FeatureCollection on your own. So it's not useful for data binding results of a query.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/flex/samples/index.html?sample=TemporalRenderer_FeatureCollection" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/webapi/flex/samples/index.html?sample=TemporalRenderer_FeatureCollection&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So far the method I have been using to extract attributes from a FeatureLayer is manually.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
protected function extractAttributesFromFeatures(features:Array):Array {
 var f:Array = [];
 var g:Graphic;
 for each (g in features) {
&amp;nbsp; f.push(g.attributes);
 }
 return f;
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then you can set that result to a Datagrid dataprovider.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:59:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-datagrid-with-featurelayer-attributes/m-p/51585#M1211</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2021-12-10T21:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: Populate DataGrid with FeatureLayer Attributes</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-datagrid-with-featurelayer-attributes/m-p/51586#M1212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you download the Sample Flex Viewer and look at the MXML for the Query Builder it should give you an idea on how to do it. There is a viewstack that is a datagrid populated from a selected set. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;QBData.dataProvider = fset.attributes;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Then &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&amp;nbsp; &amp;lt;mx:VBox width="100%" height="95%" minHeight="0" minWidth="0"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;mx:DataGrid id="QBData" width="100%" height="100%" itemClick="itemClick(event);" minColumnWidth="100" resizableColumns="true"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/mx:DataGrid&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/mx:VBox&amp;gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jul 2010 18:59:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-datagrid-with-featurelayer-attributes/m-p/51586#M1212</guid>
      <dc:creator>NathanEnge</dc:creator>
      <dc:date>2010-07-27T18:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: Populate DataGrid with FeatureLayer Attributes</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-datagrid-with-featurelayer-attributes/m-p/51587#M1213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for sharing your knowledge!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm able to use the attributes as the dataProvider for the dataGrid. Now I'd like to specify dataFields for dataGridColumn components, where the name of the field is in one column and the associated value in another. I think I'm having trouble accessing the arrays within the attributes object. Basically, I'm not sure what to insert as the dataField:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;mx:DataGrid id="attributeTable" dataProvider="{data}"&amp;gt; 
 &amp;lt;mx:columns&amp;gt;
&amp;nbsp; &amp;lt;mx:DataGridColumn headerText="Key" dataField="{?}"/&amp;gt;
&amp;nbsp; &amp;lt;mx:DataGridColumn headerText="Value" dataField="{?}"/&amp;gt;
 &amp;lt;/mx:columns&amp;gt;
&amp;lt;/mx:DataGrid&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Amy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:59:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-datagrid-with-featurelayer-attributes/m-p/51587#M1213</guid>
      <dc:creator>AmySmith</dc:creator>
      <dc:date>2021-12-10T21:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: Populate DataGrid with FeatureLayer Attributes</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-datagrid-with-featurelayer-attributes/m-p/51588#M1214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I'm still not 100% clear on FeatureLayers purpose. It would seem looking at examples it's usefulness is really for editing and time-aware data. I'm sure they've covered it in more detail somewhere, but I may have missed it.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, do you typically use GraphicLayer?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;So far the method I have been using to extract attributes from a FeatureLayer is manually.&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;Then you can set that result to a Datagrid dataprovider.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How do you get the reference to the features in the FeatureLayer object to pass as a parameter to your extractAttributesFromFeatures function?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Doug&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jul 2010 13:41:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-datagrid-with-featurelayer-attributes/m-p/51588#M1214</guid>
      <dc:creator>DouglasZedler</dc:creator>
      <dc:date>2010-07-28T13:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: Populate DataGrid with FeatureLayer Attributes</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-datagrid-with-featurelayer-attributes/m-p/51589#M1215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I use GraphicsLayer for miscellaneous selections, more like stuff where I just want to see a boundary, but don't care too much about the data behind it except maybe a name.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I use the FeatureLayer for a couple of items where I can leverage the RelationshipQuery to easily pull in detailed data. I can't tell you how much easier this has made pulling detailed data from SDE tables for me. Previously, I would have had to use a WebService/RemoteObject to hit the SDE directly for table queries. Now that we have access to AMF in the QueryTask which is built into FeatureLayer, it's cut my service calls down drastically.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When you do a selection using a FeatureLayer it returns an array of graphics, each with an attribute field. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So when I do this&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
AsyncToken(fLayer.selectFeatures(query, "new", new AsyncResponder(response, onFault)));
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;I use this&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
[Bindable]
featuresColl:ArrayCollection; // bind this to a DataGrid dataprovider
 
private function response(features:Array, token:Object = null):void {
 var f:Array = extractAttributesFromFeatures(features); // for loop in previous post
 featuresColl = new ArrayCollection(f);
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Graphics in the FeatureLayer are automatically show on your map and also stored in flayer.selectedFeatures&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So in comparison&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;flayer.selectedFeatures is equivalent to featureSet.features&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;but there doesn't seem to be an equivalent pointer to featureSet.attributes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I imagine this might be for performance reasons to keep Featurelayer efficient.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can review the FeatureLayerEvent which is the result when using queries with FeatureLayer to see some options&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/events/FeatureLayerEvent.html" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/events/FeatureLayerEvent.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;You can see the features array in there and you can also see that you get a FeatureSet when you use fLayer.queryFeatures, but a regular query doesn't show the graphics on the map automatically.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:59:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-datagrid-with-featurelayer-attributes/m-p/51589#M1215</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2021-12-10T21:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: Populate DataGrid with FeatureLayer Attributes</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-datagrid-with-featurelayer-attributes/m-p/51590#M1216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;To get the features from a FeatureLayer, you can use the inherited graphicProvider property:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/layers/GraphicsLayer.html#graphicProvider"&gt;http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/layers/GraphicsLayer.html#graphicProvider&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;FeatureSet.attributes is really nothing more than the extractAttributesFromFeatures function Rene has posted. You could get the attributes like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;var attributes:Array = new FeatureSet(ArrayCollection(featureLayer.graphicProvider).toArray()).attributes;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Reference:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/FeatureSet.html#attributes"&gt;http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/FeatureSet.html#attributes&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jul 2010 16:32:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-datagrid-with-featurelayer-attributes/m-p/51590#M1216</guid>
      <dc:creator>DasaPaddock</dc:creator>
      <dc:date>2010-07-28T16:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: Populate DataGrid with FeatureLayer Attributes</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-datagrid-with-featurelayer-attributes/m-p/51591#M1217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you, Dasa!&amp;nbsp; That did the job in only two lines of code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
var featureSet:FeatureSet = new FeatureSet(ArrayCollection(firePerimeter.graphicProvider).toArray());
fireDataGrid.dataProvider = featureSet.attributes;
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Doug&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:59:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-datagrid-with-featurelayer-attributes/m-p/51591#M1217</guid>
      <dc:creator>DouglasZedler</dc:creator>
      <dc:date>2021-12-10T21:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: Populate DataGrid with FeatureLayer Attributes</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-datagrid-with-featurelayer-attributes/m-p/51592#M1218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks also to Nathan and Rene for the insight and resources!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Doug&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jul 2010 16:00:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-datagrid-with-featurelayer-attributes/m-p/51592#M1218</guid>
      <dc:creator>DouglasZedler</dc:creator>
      <dc:date>2010-07-29T16:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: Populate DataGrid with FeatureLayer Attributes</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-datagrid-with-featurelayer-attributes/m-p/51593#M1219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have been following the information on this thread and it makes great sense and seems like a good starting point for what I am trying to do, but I can't get past this error: -1067: Implicit coercion of a value of type Array to an unrelated type mx.collections:IList.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My ultimate goal is to develop a data export button that will create an excel file (.xls) containing the values that are currently in the AttributeTable (essentially recreating the Table Options export to .csv, without concern of exporting location).&amp;nbsp; My thought was to use the code presented in this thread to assign the attributes from the featureLayer to a separate DataGrid that can be used as the object reference for exporting to excel.&amp;nbsp; I am using the as3xls library for this &lt;/SPAN&gt;&lt;A href="http://code.google.com/p/as3xls/" rel="nofollow noopener noreferrer" target="_blank"&gt;http://code.google.com/p/as3xls/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am not sure what is causing the error. This is my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;//Code for Data Download button
&amp;nbsp;&amp;nbsp; public function dataDownload():void
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; var featureSet:FeatureSet = new FeatureSet(ArrayCollection(myFeatureLayer.graphicProvider).toArray());
&amp;nbsp;&amp;nbsp;&amp;nbsp; ssoDataGrid.dataProvider = featureSet.attributes;
&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help in the right direction would be greatly appreciated! Thank you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;David&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:59:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-datagrid-with-featurelayer-attributes/m-p/51593#M1219</guid>
      <dc:creator>DavidBoiano</dc:creator>
      <dc:date>2021-12-10T21:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: Populate DataGrid with FeatureLayer Attributes</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-datagrid-with-featurelayer-attributes/m-p/51594#M1220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ssoDataGrid.dataProvider = new ArrayList(featureSet.attributes);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;See:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/FeatureSet.html#attributes"&gt;http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/FeatureSet.html#attributes&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/collections/ArrayList.html"&gt;http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/collections/ArrayList.html&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jun 2013 19:25:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-datagrid-with-featurelayer-attributes/m-p/51594#M1220</guid>
      <dc:creator>DasaPaddock</dc:creator>
      <dc:date>2013-06-25T19:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: Populate DataGrid with FeatureLayer Attributes</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-datagrid-with-featurelayer-attributes/m-p/51595#M1221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Dasa,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you so much for the code and resources! That solved my error problem.&amp;nbsp; It is almost working to how I need it--perhaps you or someone else can help me fine tune it!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My application has a feature layer that uses a drop down list to change the definitionExpression property of the feature layer to only show point features from a specific time frame.&amp;nbsp; There is an attribute table at the bottom of the page which updates to show only the features in the current extent, which changes with the definitionExpression.&amp;nbsp; I have created an AttributeTable skin which has removed the Table Options button because my boss did not want it there, but he does want the option to export the data in the Attribute Table to to an excel (.xls) file (not csv!) by clicking a button in the header.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to figure out some way to grab the data that is only in the current extent.&amp;nbsp; Currently, my code is grabbing the attributes from all of the features in the feature layer as defined by the current definitionExpression.&amp;nbsp; Is there some way to copy the data in the attribute table? Or some way to only add features to the featureSet that are in the current map extent?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;David&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jun 2013 12:33:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-datagrid-with-featurelayer-attributes/m-p/51595#M1221</guid>
      <dc:creator>DavidBoiano</dc:creator>
      <dc:date>2013-06-26T12:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: Populate DataGrid with FeatureLayer Attributes</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-datagrid-with-featurelayer-attributes/m-p/51596#M1222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can use Extent.intersects() to check if each feature is in the map's extent.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;See:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/geometry/Extent.html#intersects()"&gt;http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/geometry/Extent.html#intersects()&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jun 2013 14:24:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-datagrid-with-featurelayer-attributes/m-p/51596#M1222</guid>
      <dc:creator>DasaPaddock</dc:creator>
      <dc:date>2013-06-26T14:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: Populate DataGrid with FeatureLayer Attributes</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-datagrid-with-featurelayer-attributes/m-p/51597#M1223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dasa,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again for your continual assistance.&amp;nbsp; I have been struggling with making the appropriate for loop to loop through each feature in my feature layer.&amp;nbsp; My thought process was to create a new array to populate with the features that returned as true with the extent.intersects() method.&amp;nbsp; I am not sure on the correct loop to use or the syntax I guess because I can't get it to work correctly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my latest attempt:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp; public function dataDownload():void
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; var featureSet:FeatureSet = new FeatureSet(ArrayCollection(myFeatureLayer.graphicProvider).toArray());
&amp;nbsp;&amp;nbsp;&amp;nbsp; var record:Array = featureSet.attributes;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var exportSet:Array = new Array();
&amp;nbsp;&amp;nbsp;&amp;nbsp; for each(record in featureSet){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (myMap.extent.intersects(featureSet.features.geometry)){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exportSet.push(record)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; ssoDataGrid.dataProvider = new ArrayList(exportSet.attributes);
&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have been using &lt;/SPAN&gt;&lt;A href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/statements.html#for..in" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/statements.html#for..in&lt;/A&gt;&lt;SPAN&gt; to try and use the correct syntax for a for each...in loop.&amp;nbsp; I am very confused by what the variable "record" (in my case) refers to.&amp;nbsp; In the link, they use "item" to loop through but it doesn't seem to be defined anywhere or have a set data type.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas, or am I going off in the wrong direction?? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;David&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:59:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-datagrid-with-featurelayer-attributes/m-p/51597#M1223</guid>
      <dc:creator>DavidBoiano</dc:creator>
      <dc:date>2021-12-10T21:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: Populate DataGrid with FeatureLayer Attributes</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-datagrid-with-featurelayer-attributes/m-p/51598#M1224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have also unsuccessfully tried:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp; public function dataDownload():void
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; var featureSet:FeatureSet = new FeatureSet(ArrayCollection(myFeatureLayer.graphicProvider).toArray());
&amp;nbsp;&amp;nbsp;&amp;nbsp; var record:Array = featureSet.attributes;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var exportSet:Array = new Array();
&amp;nbsp;&amp;nbsp;&amp;nbsp; for (var i:int=0; i&amp;lt;record.length; i++){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (myMap.extent.intersects(record&lt;I&gt;.geometry)){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exportSet.addItemAt(record,i)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; ssoDataGrid.dataProvider = new ArrayCollection(exportSet);
&amp;nbsp;&amp;nbsp; }&lt;/I&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Trial and error continues!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:59:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/populate-datagrid-with-featurelayer-attributes/m-p/51598#M1224</guid>
      <dc:creator>DavidBoiano</dc:creator>
      <dc:date>2021-12-10T21:59:43Z</dc:date>
    </item>
  </channel>
</rss>

