title: ReferenceError: Sheet is not defined
body: <p>When I try to run this code in Google Apps Scripts to export a sheet in a .json I get &quot;ReferenceError: Sheet is not defined in Line 3&quot; I already turn on the Google Sheets API but the outcome its the same</p>
  <pre><code>function getData(spreadsheetId, sheet){
    var rangeName = sheet+'A:Z';
    var values = Sheet.Spreadsheets.Value.get(spreadsheetId, rangeName).values;
    
    if(!values){
      return {error: 'No data found'};
    } else {
     
      var responseJson = [];
      
      for(var row = 1; row &lt; values.lenght; row++){
        var item = {};
        
        for(var column = 0; column &lt; 100; column++){
          item[values[0].column] = values[row][column];      
        }
        responseJson.push(item);
      }
      return responseJson;
    }
  }
  
  function doGet(request) {
    if (request.parameter.spreadsheetId != undefined &amp;&amp; request.parameter.sheet != undefined){
      return ContentService.createTextOutput(JSON.stringify(getData(request.parameter.spreadsheetId, request.parameter.sheet)));
    } else {
      return ContentService.createTextOutput(JSON.stringify({error: &quot;Parameter spreadsheetId or sheet nor found&quot;}));
    }
    
  }
  </code></pre>