I found this old thread, but cannot seem to get any of the methods to work.
Issue: I have a spreadsheet that dozens of people use, and over time there have been >200 Filter View's created. I want to mass delete ALL Filter View's from one sheet in the workbook.
I've tried this method after enabling Google Sheets API. It runs, but alas, all the Filter View's remain.
function clearFilter() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var ssId = ss.getId();
var sheetId = ss.getActiveSheet().getSheetId();
var requests = [{
"clearBasicFilter": {
"sheetId": sheetId
}
}];
Sheets.Spreadsheets.batchUpdate({'requests': requests}, ssId);
}
Thanks All