function changeData(auth,sheetId) {
var sheets = google.sheets(\'v4\');
sheets.spreadsheets.values.update({
auth: auth,
spreadsheetId: sheetId,
range
If you are using googleapis after the version of v26.0.1 (now it's 32.0.0.), in your script, you can retrieve the data by result.data. So how about the following modification?
var numRows = result.values ? result.values.length : 0;
var numRows = result.data.values ? result.data.values.length : 0;