title: Add multiple rows to Google Spreadsheet via API
body: <p>I can add a new row to a Google spreadsheet with this code:</p>
  
  <pre><code>$valueRange = new Google_Service_Sheets_ValueRange();
  $valueRange-&gt;setValues(["values" =&gt; ['data1', 'data2']]);
  $range = 'Sheet1!A1:A';
  $conf = ["valueInputOption" =&gt; "USER_ENTERED"];
  $service-&gt;spreadsheets_values-&gt;append($spreadsheetId, $range, $valueRange, $conf);
  </code></pre>
  
  <p>How should I change the setValues params to add multiple rows?</p>
  
  <p>Thank you.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>In the meantime I use this approach:</p>
  
  <pre><code>$range_number = 1; // Keep spreadsheet header
  $data = array();
  for($i=0;$i&lt;count($data);$i++){
      $range_number++;
      $range = 'Sheet1!A'.$range_number.':XX';
      $values = array( array($data1[$i], $data2[$i], $data3[$i]) );
      $data[] = new Google_Service_Sheets_ValueRange(
          array( 'range' =&gt; $range, 'values' =&gt; $values )
      );
  }
  $body = new Google_Service_Sheets_BatchUpdateValuesRequest(array(
    'valueInputOption' =&gt; "USER_ENTERED",
    'data' =&gt; $data
  ));
  $result = $service-&gt;spreadsheets_values-&gt;batchUpdate($spreadsheetId, $body);
  
  // Clear rest of spreadsheet
  $range_number++;
  $range = 'Sheet1!A'.$range_number.':XX';
  $clearRange = new Google_Service_Sheets_ClearValuesRequest();
  $service-&gt;spreadsheets_values-&gt;clear($spreadsheetId, $range, $clearRange);
  </code></pre>
  
  <p>But this way I have to send the previous data as well. My goal would be just to append the new data.</p>