I'm inserting data into sheets using append, but the new data ends up being inserted in random positions. Sometimes at the bottom, sometimes at the top. Apparently sometimes in the middle also, although I've not witnessed that myself yet.
I think it's caused when sheet users have added filtering on the sheet. When a filter is active on the sheet, it appears to affect where the new data is inserted on the sheet, although I'm not 100% certain that this is the case.
There is no sorting on the sheet.
Any idea how to ensure new entries are only appended to the bottom always?
const result = await sheets.spreadsheets.values.append({
spreadsheetId: spreadsheetId,
range: range,
valueInputOption: "RAW",
insertDataOption: "INSERT_ROWS",
resource: {
values: data
}
});
For the above, range is SheetName!A:A so I'm not specifying any row.