Rows can be deleted using batchUpdate
API.
resource = {"requests":
[
{"deleteDimension": {
"range":{
"sheetId":0,
"dimension":"ROWS",
"startIndex":20,
"endIndex":21}
}
}
]
}
batchReqBody = {spreadsheetId: spreadSheet, resource: resource}
client.spreadsheets.batchUpdate(batchReqBody)
startIndex
specify the range start. This row is not deleted. For instance, the range is startIndex = 16
and endIndex = 20
, it will delete rows 17, 18, 19, and 20.