adjust Filter View range?

273 views
Skip to first unread message

Ed-alt Wu

unread,
Apr 18, 2019, 8:47:41 PM4/18/19
to Google Apps Script Community
Is there a way to adjust Filter View ranges via script? We have Filter Views where the row ranges constantly get messed up when people and/or other scripts add/delete rows.

e.g. if a Sheet currently has 100 rows...so a Filter View is set so it covers e.g. A1 to D100...
after rows are deleted/added manually or via script, eventually it'll end up something like the Sheet has 109 or 88 rows, but the Filter View now only covers say A1 to D76.

I'd like to "reset" the Filter View daily so it automatically covers A1 to D(last row)

Can this be done?

Romain Vialard

unread,
Apr 19, 2019, 4:38:13 AM4/19/19
to Google Apps Script Community
Sure. You will need to use the Sheets Advanced Service for that.

Here are some examples on how to play with the standard filters via this advanced service:

And the documentation of the Sheets API on how to update a filtered view (you need to indicate the filterViewId):
Reply all
Reply to author
Forward
0 new messages