I'm able to make an addFilterView
request using the batchUpdate
. My question is that how can I retrieve the created filterViewId
?
Here is the code I'm using:
var filterSettings = {
"title":criteria,
"range": {
"sheetId": sheetId,
"startRowIndex": startRowIndex,
"endRowIndex": 99999,
"startColumnIndex": 0,
"endColumnIndex": lastColumn
},
"criteria": {
}
};
filterSettings.criteria[colNo] = {
"condition": {
"type": "TEXT_CONTAINS",
"values": [
{
"userEnteredValue": criteria
}
]
}
}
var requests = [{
"addFilterView": {
"filter": filterSettings
}
}];
Sheets.Spreadsheets.batchUpdate(
{
requests: requests
},
ssId
);