title: Appending a new row with only formulas using Sheets API v4
body: <p>I'm pretty new to Sheets API and get a lot of bugs.</p>
  
  <p>I would like to append a new row to sheet based on last row. This would include copying the format and pasting formulas with an autofill but not the values.</p>
  
  <p>Here what I've came up using app script.
  I'm sure I'm not using the best way so for the moment I've</p>
  
  <ul>
  <li>retrieved formulas from range SUCCESS</li>
  <li>tried using <code>autoFillRequest</code> to populate next row with 10 columns(just a try). FAILED</li>
  </ul>
  
  <p>I've put in comment the getFormulas-like request and show you what I have for the moment with the autoFill request.</p>
  
  <p>I get the following error:</p>
  
  <blockquote>
    <p>Invalid JSON payload received. Unknown name "source_and_destination" at 'requests[0]': Cannot find field. </p>
  </blockquote>
  
  <pre><code>function insertNewRow(){
    var ssId = "my_spreadsheet_id"
    /*var params = {
      ranges: ['Feuille1!21:21'],
      valueRenderOption: 'FORMULA'
    };
    var values = Sheets.Spreadsheets.Values.batchGet(ssId, params);
    var valueRange = Sheets.newValueRange();
    valueRange.majorDimension = "ROWS";
    valueRange.values = values.valueRanges[0].values;
    Logger.log(values.valueRanges[0].values[0].length);
    valueRange.range= 'Feuille1!22:22'
    //var req = Sheets.Spreadsheets.Values.update(valueRange , ssId, 'Feuille1!22:22', {
    //  valueInputOption: 'USER_ENTERED'
    //})*/
    var AFreq = Sheets.newAutoFillRequest();
  
    AFreq.range = Sheets.newGridRange();
    AFreq.range.startRowIndex = 1;
    AFreq.range.startColumnIndex = 0;
    AFreq.range.endRowIndex = 2;
    AFreq.range.endColumnIndex = 10;
    AFreq.range.sheetId = 0;
  
    AFreq.sourceAndDestination = Sheets.newSourceAndDestination();
    AFreq.sourceAndDestination.dimension = "ROWS";
    AFreq.sourceAndDestination.fillLength = 10;
  
    AFreq.sourceAndDestination.source = Sheets.newGridRange();
    AFreq.sourceAndDestination.source.startRowIndex = 0;
    AFreq.sourceAndDestination.source.startColumnIndex = 0;
    AFreq.sourceAndDestination.source.endColumnIndex = 10   
    AFreq.sourceAndDestination.source.endRowIndex = 1;
    AFreq.sourceAndDestination.source.sheetId = 0;
  
    var req = Sheets.newBatchUpdateSpreadsheetRequest();
    req.requests = [AFreq];
    Sheets.Spreadsheets.batchUpdate(req, ssId);
    }
  </code></pre>
  
  <p>Tell me if I'm wrong but I though about separating the tasks into multiple requests</p>
  
  <ol>
  <li>grab the formulas</li>
  <li>insert new row</li>
  <li>copy/paste preceding fromat to new row</li>
  <li>pasting formulas</li>
  </ol>
  
  <p>Am I going in the right direction?
  Any help is greatly appreciated.</p>