title: importing nested JSON to Google Spreadsheets
body: <p>
  Hi!
  I'm trying to import data from a nested JSON into Google spreadsheets. I use code that has worked perfectly with another nested JSON but now I'm getting the JSON from a different API and it looks slightly different and it throws a "The coordinates or dimensions of the range are invalid. (line 18, file "Code")"-error, referring to the line;</p>
  
  <pre><code>dataRange = sheet.getRange(2, 1, rows.length, 5);
  </code></pre>
  
  <p>I use the following code;</p>
  
  
  
  <pre><code>function getHistoricalRatesETH() {
      var ss = SpreadsheetApp.getActiveSpreadsheet();
      var sheets = ss.getSheets();
      var sheet = ss.getSheetByName("getData");
      ss.setSpreadsheetLocale('en-us');
      var url="https://min-api.cryptocompare.com/data/histoday?fsym=ETH&amp;tsym=USD&amp;limit=1460"; 
      var response = UrlFetchApp.fetch(url); // get feed
      var dataAll = JSON.parse(response.getContentText()); //
      var dataSet = dataAll;
      var rows = [],data;
      for (i = 0; i &lt; dataSet.length; i++) {
          data = dataSet[i];
          rows.push([data.time,data.close,data.high,data.low,data.open]);
      }
      dataRange = sheet.getRange(2, 1, rows.length, 5); //Last digit denotes columns
      dataRange.setValues(rows);
      ss.setSpreadsheetLocale('en-us');
  } 
  </code></pre>
  
  <p>
  I tried to change</p>
  
  <pre><code>var rows = [],data; 
  </code></pre>
  
  <p>to </p>
  
  <pre><code>var rows = [],Data; 
  </code></pre>
  
  <p>Also tried using the ids </p>
  
  <pre><code>rows.push([data.Data.time,data.Data.close,data.Data.high,data.Data.low,data.Data.open]);
  </code></pre>
  
  <p>But the result is the same.</p>
  
  <p>I've tripple-checked so the sheet name isn't misspelt and 
  searched like crazy on how to address a nested json but to no avail. </p>