<?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 Javascript API how do I access the attributes for a feature that is selected (client-side) and do a calculation on the attribute table values for that feature? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-how-do-i-access-the/m-p/693172#M64414</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LINK TO MY CODE: &lt;A href="https://gist.github.com/saraneh/e2d1b1e8ebe049f947148f92d0b64f18" rel="noopener noreferrer" target="_blank"&gt;https://gist.github.com/saraneh/e2d1b1e8ebe049f947148f92d0b64f18&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This program is a map which shows two layers: a flood layer and a county layer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can select which county you are interested in with the drop down, and when you select it it returns the geometry for that feature.There are also 3 other dropdowns (numeric arrays).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I can't figure out is how to also access the attributes for the county selected. I want to be able to (depending on the county selected) access the values for the fields in the attribute table and then do a calculation with those values&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Dec 2019 16:30:05 GMT</pubDate>
    <dc:creator>EdFratto</dc:creator>
    <dc:date>2019-12-18T16:30:05Z</dc:date>
    <item>
      <title>ArcGIS Javascript API how do I access the attributes for a feature that is selected (client-side) and do a calculation on the attribute table values for that feature?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-how-do-i-access-the/m-p/693172#M64414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LINK TO MY CODE: &lt;A href="https://gist.github.com/saraneh/e2d1b1e8ebe049f947148f92d0b64f18" rel="noopener noreferrer" target="_blank"&gt;https://gist.github.com/saraneh/e2d1b1e8ebe049f947148f92d0b64f18&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This program is a map which shows two layers: a flood layer and a county layer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can select which county you are interested in with the drop down, and when you select it it returns the geometry for that feature.There are also 3 other dropdowns (numeric arrays).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I can't figure out is how to also access the attributes for the county selected. I want to be able to (depending on the county selected) access the values for the fields in the attribute table and then do a calculation with those values&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Dec 2019 16:30:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-how-do-i-access-the/m-p/693172#M64414</guid>
      <dc:creator>EdFratto</dc:creator>
      <dc:date>2019-12-18T16:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Javascript API how do I access the attributes for a feature that is selected (client-side) and do a calculation on the attribute table values for that feature?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-how-do-i-access-the/m-p/693173#M64415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ed,&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can access the attributes of a feature in a similar way to how you access the geometry of the feature after querying for it using queryFeatures. From your code:&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;return wellsLayer.queryFeatures(wellsQuery).then(function(response) {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;wellsGeometries = response.features.map(function(feature) {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;console.log(feature.attributes);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return feature.geometry;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;});&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;return wellsGeometries;&lt;BR /&gt; });&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Inside the &lt;SPAN style="font-family: 'andale mono', monospace;"&gt;response.features.map&lt;/SPAN&gt;... you can access the attributes of the feature using the&amp;nbsp;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#attributes"&gt;feature.attributes&lt;/A&gt;&lt;/SPAN&gt; property. Hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Anne&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Dec 2019 19:56:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-how-do-i-access-the/m-p/693173#M64415</guid>
      <dc:creator>AnneFitz</dc:creator>
      <dc:date>2019-12-18T19:56:52Z</dc:date>
    </item>
  </channel>
</rss>

