Is anyone familiar with how to use the insertDimension request to insert a row above existing data? I am having trouble finding documentation on specifying where to add the row within the spreadsheet. The code I have inserts the row at the bottom, and I'm struggling with the new API...
function insertRow() {
return new Promise((resolve, reject) => {
var sheets = google.sheets('v4');
var options = {
auth: auth,
spreadsheetId: spreadsheetId,
resource: {
requests: [{
insertDimension: {
range: {
sheetId: 1769404692,
dimension: "ROWS",
startIndex: 1,
endIndex: 2
},
inheritBefore: true
}
}],
}
}
sheets.spreadsheets.batchUpdate(options, (err, res) => {
if (err) {
reject(err);
} else {
resolve(res);
}
});
});
}
The code successfully inserts a row, but not in the desired location.