Google apps script 如何通过应用程序脚本将FilterView应用于Gsheet
我已经创建了一些谷歌应用程序脚本代码,用于创建GSheetsGoogle apps script 如何通过应用程序脚本将FilterView应用于Gsheet,google-apps-script,google-sheets,google-sheets-api,Google Apps Script,Google Sheets,Google Sheets Api,我已经创建了一些谷歌应用程序脚本代码,用于创建GSheetsFilterViews。我看不到如何将特定的FilterViews(而不是Filters)应用于当前工作表 我的代码设置了FilterSettings,然后将其应用于基本过滤器,但在文档中我看不到如何将类似的方法应用于filterview if (condition!=0 && hiddenValues.length>0) { filterSettings['criteria'][COLUMNS.ASS
FilterViews
。我看不到如何将特定的FilterViews
(而不是Filters
)应用于当前工作表
我的代码设置了FilterSettings,然后将其应用于基本过滤器,但在文档中我看不到如何将类似的方法应用于filterview
if (condition!=0 && hiddenValues.length>0)
{
filterSettings['criteria'][COLUMNS.ASSIGNEE.pos] = {
'hiddenValues': hiddenValues,
'condition': condition
};
}
else if(hiddenValues.length>0)
{
filterSettings['criteria'][COLUMNS.ASSIGNEE.pos] = {
'hiddenValues': hiddenValues,
};
}
else if(condition!=0)
{
filterSettings['criteria'][COLUMNS.ASSIGNEE.pos] = {
'condition': condition
};
}
// Using BASIC FILTER not FILTER VIEW
var request = {
"setBasicFilter": {
"filter": filterSettings
}
}
Sheets.Spreadsheets.batchUpdate({'requests': [request]}, ss.getId());
我看过这份文件:-
我可以看出,从历史上看,它没有得到支持,但我想知道情况是否仍然如此
如果我看一下requests API,就会发现有以下请求类型:-
- addFilterView
- 删除过滤器视图
- updateFilterView
- 重复过滤视图