<?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 Pulling data from an esriRequest in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/pulling-data-from-an-esrirequest/m-p/431395#M39709</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey All,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; I am using an esri/request call to get data back from an api. Now I'm trying to pick out individual pieces of that data and push them to an empty array that I can further manipulate. Here is how I have the esriRequest code setup. Notice I have a little function called `showResults` to use instead of console.info(resp). I wanted to use this to try and dissect the data be returned in the response (resp):&lt;/P&gt;&lt;P&gt;esriRequest({&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; url:"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fapi.census.gov%2Fdata%2F2016%2Facs%2Facs5" rel="nofollow" target="_blank"&gt;https://api.census.gov/data/2016/acs/acs5&lt;/A&gt;&lt;SPAN&gt;",&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; content:{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; get: 'NAME,B01003_001E,B02001_001E,B06007_001E,B06010_001E',&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for: `tract:${ACS_TRCT}`,&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; in: [`state:${ACS_ST}`,`county:${ACS_CNTY}`]&lt;BR /&gt;&amp;nbsp; &amp;nbsp; },&lt;BR /&gt;&amp;nbsp; &amp;nbsp; handleAs:'json',&lt;BR /&gt;&amp;nbsp; &amp;nbsp; timeout:15000&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }).then(function(resp){&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; console.info(resp);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; // showResults(resp);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }, function(error){&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; alert("Data failed" + error.message);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; });&lt;BR /&gt;&amp;nbsp; &amp;nbsp; function showResults(resp) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; console.log(resp.data);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; };&lt;BR /&gt; ....&lt;/P&gt;&lt;P&gt;Basically, the call returns an object with 2 arrays; 1 that is basically labels and 2 the actual data I want. Essentially I am trying to pick out the data from array 2 ( or array[1], if you will), index 1-4.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/415101_pastedImage_11.png" /&gt;&lt;/P&gt;&lt;P&gt;When I try to use my showResults function that uses console.log(resp.data); , it just returns `undefined`. What am I doing wrong here and how do pick out the array[1] data?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Jul 2018 14:14:42 GMT</pubDate>
    <dc:creator>JustinBridwell2</dc:creator>
    <dc:date>2018-07-25T14:14:42Z</dc:date>
    <item>
      <title>Pulling data from an esriRequest</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/pulling-data-from-an-esrirequest/m-p/431395#M39709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey All,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; I am using an esri/request call to get data back from an api. Now I'm trying to pick out individual pieces of that data and push them to an empty array that I can further manipulate. Here is how I have the esriRequest code setup. Notice I have a little function called `showResults` to use instead of console.info(resp). I wanted to use this to try and dissect the data be returned in the response (resp):&lt;/P&gt;&lt;P&gt;esriRequest({&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; url:"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fapi.census.gov%2Fdata%2F2016%2Facs%2Facs5" rel="nofollow" target="_blank"&gt;https://api.census.gov/data/2016/acs/acs5&lt;/A&gt;&lt;SPAN&gt;",&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; content:{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; get: 'NAME,B01003_001E,B02001_001E,B06007_001E,B06010_001E',&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for: `tract:${ACS_TRCT}`,&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; in: [`state:${ACS_ST}`,`county:${ACS_CNTY}`]&lt;BR /&gt;&amp;nbsp; &amp;nbsp; },&lt;BR /&gt;&amp;nbsp; &amp;nbsp; handleAs:'json',&lt;BR /&gt;&amp;nbsp; &amp;nbsp; timeout:15000&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }).then(function(resp){&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; console.info(resp);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; // showResults(resp);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }, function(error){&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; alert("Data failed" + error.message);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; });&lt;BR /&gt;&amp;nbsp; &amp;nbsp; function showResults(resp) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; console.log(resp.data);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; };&lt;BR /&gt; ....&lt;/P&gt;&lt;P&gt;Basically, the call returns an object with 2 arrays; 1 that is basically labels and 2 the actual data I want. Essentially I am trying to pick out the data from array 2 ( or array[1], if you will), index 1-4.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/415101_pastedImage_11.png" /&gt;&lt;/P&gt;&lt;P&gt;When I try to use my showResults function that uses console.log(resp.data); , it just returns `undefined`. What am I doing wrong here and how do pick out the array[1] data?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2018 14:14:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/pulling-data-from-an-esrirequest/m-p/431395#M39709</guid>
      <dc:creator>JustinBridwell2</dc:creator>
      <dc:date>2018-07-25T14:14:42Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling data from an esriRequest</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/pulling-data-from-an-esrirequest/m-p/431396#M39710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You just have to use&lt;/P&gt;&lt;PRE class="language-javascript line-numbers"&gt;&lt;CODE&gt;console&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;log&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;resp&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2018 15:32:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/pulling-data-from-an-esrirequest/m-p/431396#M39710</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2018-07-25T15:32:56Z</dc:date>
    </item>
  </channel>
</rss>

