title: Apps Script, convert a Sheet range to Blob
body: <p>Background: 
  I'm trying to upload an individual row of data from a Google Sheet and append it to a BigQuery table. </p>
  
  <p>Method: I've been using <a href="https://developers.google.com/apps-script/advanced/bigquery" rel="noreferrer">https://developers.google.com/apps-script/advanced/bigquery</a> to do this, but instead of a file of data as the example is, I am using my own sheet with data from a specific row:</p>
  
  <pre><code> var file = SpreadsheetApp.getActiveSpreadsheet();
    var currentSheet = file.getSheetByName(name);
    var lastRow = currentSheet.getLastRow()
     var lastC = currentSheet.getLastColumn()
     var rows = currentSheet.getRange(2,1,1,lastC).getValues();
  </code></pre>
  
  <p>"rows" is the row of data to be imported to BQ. I've tried a multitude of things, and according to another <a href="https://stackoverflow.com/questions/28327109/google-apps-script-convert-to-csv">StackOverflow question</a>, "rowsCSV" makes the 2D array of values CSV. </p>
  
  <pre><code>  var rowsCSV = rows.join("\n");
  
   var data = rowsCSV.getBlob().setContentType('application/octet-stream');
  </code></pre>
  
  <p>Problem: Every time I run the function, I get the error "Cannot find function getBlob in object Blob. " or, "Cannot convert Array to (class)[][]", or "Cannot find function getBlob in object Tue May 16 2017 00:00:00 GMT+0200 (CEST),58072.4,,,,,,,,,,,test ", where the last bit ("Tue May..") is the actual data of the row.</p>
  
  <p>What am I doing wrong here?</p>