AnsweredAssumed Answered

Pulling data from an esriRequest

Question asked by jbridwell_Dewberry on Jul 25, 2018
Latest reply on Jul 25, 2018 by kenbuja

Hey All,

      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 I wanted to use this to try and dissect the data be returned in the response (resp):

        get: 'NAME,B01003_001E,B02001_001E,B06007_001E,B06010_001E',
        for: `tract:${ACS_TRCT}`,
        in: [`state:${ACS_ST}`,`county:${ACS_CNTY}`]
    // showResults(resp);
    }, function(error){
        alert("Data failed" + error.message);
    function showResults(resp) {


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.

When I try to use my showResults function that uses console.log(; , it just returns `undefined`. What am I doing wrong here and how do pick out the array[1] data?