title: Getting values from JSON using appscript
body: <p>I'm creating two-dimentional array with google appscript using chrome devices users with the JSON response from a directory. I've been able to get values. However, when I try to get recentUsers represented as:</p>
  <pre><code>    {
      &quot;kind&quot;: &quot;directory#chromeosdevices&quot;,
      &quot;chromeosdevices&quot;: [
       {
         &quot;kind&quot;: &quot;directory#chromeosdevice&quot;,
         &quot;etag&quot;: &quot;1234567890&quot;
         &quot;deviceId&quot;: &quot;def456&quot;,
         &quot;serialNumber&quot;: &quot;234567&quot;,
         &quot;status&quot;: &quot;ACTIVE&quot;,
         &quot;lastSync&quot;: &quot;2013-03-05T17:30:04.325Z&quot;,
         &quot;supportEndDate&quot;: &quot;2014-04-05T17:30:04.325Z&quot;,
         &quot;annotatedUser&quot;: &quot;help desk&quot;,
         &quot;annotatedLocation&quot;: &quot;Mountain View help desk Chromebook&quot;,
         &quot;annotatedAssetId&quot;: &quot;1234567890&quot;,
         &quot;notes&quot;: &quot;Loaned from support&quot;,
         &quot;orderNumber&quot;: &quot;1234&quot;,
         &quot;willAutoRenew&quot;: true,
         &quot;osVersion&quot;: &quot;Browser Version 18.0&quot;,
         &quot;platformVersion&quot;: &quot;Platform Version 1415.2.0&quot;,
         &quot;firmwareVersion&quot;: &quot;Firmware Version 1.2.3.4&quot;,
         &quot;bootMode&quot;: &quot;validated&quot;,
         &quot;lastEnrollmentTime&quot;: &quot;2012-04-05T17:30:04.325Z&quot;,
         &quot;orgUnitPath&quot;: &quot;corp/engineering&quot;,
         &quot;recentUsers&quot;: [
           {
             &quot;type&quot;: &quot;USER_TYPE_MANAGED&quot;,
             &quot;email&quot;: &quot;user@customer.com&quot; //I'm trying to get the most recent user's email 
           }
         ],
         &quot;activeTimeRanges&quot;: [
           {
             &quot;date&quot;: &quot;2012-04-05&quot;,
             &quot;activeTime&quot;: &quot;3600000&quot;
           }
         ],
       }
    ],
    &quot;nextPageToken&quot;: &quot;abcdefghijkl123&quot;
  }
  </code></pre>
  <p>I get an array but I can't get the value. I'm trying to get the most recent user's email. Anyone have experience with appscript? I've tried recentUsers[0].email and recentUser[0]['email']. This is the code I have to far: //I commented where I'm trying to push a value
  enter code here</p>
  <pre><code>var chromeArgs = {   
    maxResults: 200,
    orderBy: 'annotatedUser',
    projection: &quot;FULL&quot;
   
  };
  
  
  var getChromes = (AdminDirectory.Chromeosdevices.list('XXXXXXXXX', chromeArgs));
  
  var chromes = getChromes.chromeosdevices;
     if (chromes &amp;&amp; chromes.length &gt; 0) {
   Logger.log('Devices:');
   //2d array
   var wholeValues = [];
  
       for (var i = 0; i &lt; chromes.length; i++){  
  //create a 1D array first with pushing 0,1,2 elements with a for loop
     var value = [];
     for (var j = 0; j &lt; 1; j++) {
       var chrms = chromes[i];
       var recentUser = chrms.recentUsers;
       value.push(recentUser[0].email); // Here is where I need help 
  }
      //pushing the value array with [0,1,2] to thw wholeValues array. 
      wholeValues.push(value);
    } // the outer for loop runs five times , so five the 0,1,2 with be pushed in to thewholevalues array by creating wholeValues[0][0],wholeValues[0][1]...till..wholeValues[4][2]
  
    Logger.log(wholeValues); '''
  </code></pre>