Having some difficulty with forming the request to append data on a Google Sheet using the API v4:
Referring to this link, I have attempted to use the append method in my Google App Script, but I am getting an error message, which does not make sense, as I have tried every single combination?
Code Snippet
var request = {
spreadsheetId: spreadsheetId,
range: sheetName + "!A:D",
insertDataOption: "INSERT_ROWS",
responseDateTimeRenderOption: "SERIAL_NUMBER",
responseValueRenderOption: "FORMATTED_VALUE",
valueInputOption: "USER_ENTERED",
includeValuesInResponse: true,
resource: {
range: sheetName + "!A:D",
majorDimension: "ROWS",
values: [["2018-01-01", "2", "3", "4"]]
}
};
Sheets.Spreadsheets.Values.append(request);
Error
Exception: Invalid number of arguments provided. Expected 3-4 only
I wish there were better samples and documentation to help here?
Thanks in Advance
Try this: