Fixed
Status Update
Comments
sa...@google.com <sa...@google.com>
ri...@gmail.com <ri...@gmail.com> #2
A must!
jp...@gmail.com <jp...@gmail.com> #4
Very interesting!
ki...@gmail.com <ki...@gmail.com> #5
Excellent suggestion. Is this on the radar for implementation? +1 for #7 - I would definitely like to see programmatic controls of filters via script.
m....@gmail.com <m....@gmail.com> #6
Given that these methods exist in the Google Visualisation API it would be good if the same method statements and functionality were used http://code.google.com/apis/chart/interactive/docs/reference.html#DataView
su...@gmail.com <su...@gmail.com> #7
Must thing.
[Deleted User] <[Deleted User]> #8
I've tested it, and you can use the Array.filter() method in GAS so for some applications this is a better alternative than manipulating spreadsheet (which is a more expensive operation since it has to be pushed to the client).
https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/filter
Also, search for "javascript array filter examples" for more info.
Also, search for "javascript array filter examples" for more info.
ri...@gmail.com <ri...@gmail.com> #9
I have also used Array.filter(), Array.reduce(), Array.map() <= they work fine. However, they are not documented and cannot be found anywhere on GAS. It still works though.
[Deleted User] <[Deleted User]> #10
Those aren't GAS functions, they're standard JavaScript functions. The GAS documentations suggests Mozilla's excellent JavaScript resources for more information (although there are alternatives).
Seehttps://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array#Iteration_methods for more info.
See
ri...@gmail.com <ri...@gmail.com> #11
The difference here is; in the GAS editor the popups do list Array.push(), .pop() etc. which are Javascript functions. So I am comfortable in using them in the sense Google has acknowledged and supported those functions. But Array.map(), .reduce(), .filter() are not available as methods on the Array object in the GAS editor.
Hence, the hesitation and ambiguity.
But AFAIK, they do work.
Hence, the hesitation and ambiguity.
But AFAIK, they do work.
pe...@pezius.com <pe...@pezius.com> #12
I really need getFilteredRows()! Preferably it would return a range similar to getActiveSelection().
ne...@gmail.com <ne...@gmail.com> #13
I would like similar functionality for hidden rows. I need to know if a row is hidden, so it can be skipped. Simply setting the state isn't useful, similar to background color. It is useful to get the current state as well as setting.
mg...@interpunkt.hr <mg...@interpunkt.hr> #14
This functionality is also important for data driven spreadsheets (using jdbc, etc.) since a user applied filter can play havoc with applying data sets. The clearfilter function is the most important here..
in...@gmail.com <in...@gmail.com> #15
Must thing.
re...@gmail.com <re...@gmail.com> #16
I was migrating my App from HTML to Google Script, and I assumed that both implementations shared the same functionality, I hitted this wall when I was implementing the filters I need to generate my Charts (e.g. total of sales by employee out of the sales history).
I was trying to implement this:
var filterDateStoreSale = new google.visualization.data.group(
data,
[4,3], // Group by |Date|
[{'column': 5, 'aggregation': google.visualization.data.sum, 'type': 'number'}] //|Store|sum:|Sale|
);
In my opinnion, adding grouped values is extremely useful for bulding usefull Charts out of SpreadSheets while programming on Google Scripts. I hope the guys at Google fix this soon.
I was trying to implement this:
var filterDateStoreSale = new google.visualization.data.group(
data,
[4,3], // Group by |Date|
[{'column': 5, 'aggregation': google.visualization.data.sum, 'type': 'number'}] //|Store|sum:|Sale|
);
In my opinnion, adding grouped values is extremely useful for bulding usefull Charts out of SpreadSheets while programming on Google Scripts. I hope the guys at Google fix this soon.
ma...@gmail.com <ma...@gmail.com> #17
Agree a very useful functionality
[Deleted User] <[Deleted User]> #18
Indded very useful
pj...@gmail.com <pj...@gmail.com> #19
Any update on this feature request?
ge...@gmail.com <ge...@gmail.com> #20
I am working on a spreadsheet where I extend the number of rows and paste in additional data. Unfortunately the filter capability does not follow for the added rows. I would like to extend the filter capability to the new rows using the script that creates the new rows. I need this capability to do that sort of thing.
al...@alucab.org <al...@alucab.org> #21
Yes i totally support it.
From a user point of view is particularly important, otherwise the user is obliged to deactivate and reactivate the filter every time there is an update in the sheet, a row addition or deletion
From a user point of view is particularly important, otherwise the user is obliged to deactivate and reactivate the filter every time there is an update in the sheet, a row addition or deletion
ar...@trbls.com <ar...@trbls.com> #22
when will that be implemented GOOGLE ?
je...@gmail.com <je...@gmail.com> #23
+1 for #6. This seems like it should be reasonably easy to implement and of great use for documents with filters used by multiple people. That way when someone filters the data and then closes the document without clearing the filter criteria it will reset automatically.
an...@gmail.com <an...@gmail.com> #24
Hopefully there is a plan to provide an apps script equivalent to the new Filter Views functionality just released. Seems logical that a filtering class would provide access to create and modify "traditional" filters and also create/modify/activate the new filter views. I'm hopeful!
[Deleted User] <[Deleted User]> #25
Feature urgently needed to filter a Range of a spreadsheet, according to data collected in another spreadsheet, itself populated with data issued from a Google form!
ad...@gmail.com <ad...@gmail.com> #27
for me, the entire filtering class would be a huge help (like in Excel VBA). I am running into issues with range copies because filters are set and I cannot clear them through script...
ar...@trbls.com <ar...@trbls.com> #28
please implement this. We need to clear all filter onOpen event. We use the spreadsheet as the register. To eliminate duplicates we need to disable filter onOpen.
an...@castbefore.com <an...@castbefore.com> #29
This will bring a lot of business values! Especially the ScriptDB is now decommissioned and even though CloudSQL is there, new Sheet is actually the most reasonable small database for small business (division). The point is if there is no query language or tool to support searching content or records in sheet, an API to support creating filters, then get filtered rows would simply mimic a query language already.
This is not just +1 from me, it's +20! We can't wait, please implement this.
This is not just +1 from me, it's +20! We can't wait, please implement this.
[Deleted User] <[Deleted User]> #30
In my opinion, clearFilter() is the function that would bring greater value. It is not unusual to happen that someone is filtering a worksheet when a script runs and eventually errors occur, because of the filters. With the function, the script can remove filters before starting. With the others functions, it could even return to the state that the user is filtering left.
ar...@trbls.com <ar...@trbls.com> #31
currently there is no way of establishing from API whether the filter is on or off. onOpen trigger we need to clear all filters which could be set by other person.
Please implement clearFilters() and isFilterOn(columnNo) functions.
Thanks,
Arthur
Please implement clearFilters() and isFilterOn(columnNo) functions.
Thanks,
Arthur
jo...@ascensoreslaplata.com.ar <jo...@ascensoreslaplata.com.ar> #32
A way to handle filter view created filters will be useful also. Some of my users always create filters that don't reuse and the list of created filters (auto named filters) continuously grows and the only way to clear them is one by one.
ar...@trbls.com <ar...@trbls.com> #33
If you use the spreadsheet to store unique numbers in each row and If someone forgets to clear filter before assigning new number then your numbers are not unique any more. That is not acceptable for our company and the reason why we still use EXCEL.
ar...@trbls.com <ar...@trbls.com> #34
forgotten attachement
zi...@cloudware360.com.pe <zi...@cloudware360.com.pe> #35
All the use cases i see here can be handled by writting scripts that do the filtering and ux (not spreadsheet) to display/enter data.
The only valid case i think is a way to clear the filter, but this was solved recently by the new sheets saved user-filters which do not modify other user's views.
The only valid case i think is a way to clear the filter, but this was solved recently by the new sheets saved user-filters which do not modify other user's views.
ra...@gmail.com <ra...@gmail.com> #36
[Comment deleted]
ra...@gmail.com <ra...@gmail.com> #37
It would be great if there was a way of filtering/ hiding columns. I have written my own script which checks for values in row 1 and then filters or unhides a particular column based on results. Since my script takes long time to execute and hiding/unhiding affects other users, we are not using this feature.
ad...@gmail.com <ad...@gmail.com> #38
I absolutely agree that ability to clear and set filters is really needed to be able to automate sheet app solutions. In many cases, if a filter has been set and you try to modify a cell (lets say to add a specific "=query" value into the cell, the script crashes unless you turn off filters. Would like to be able to:
1. determine if a filter has been set on a sheet
2. what the filter parameters are (so I could return the sheet the the original state)
3. clear a filter
4. set a filter with specific parameters
btw, I did this often in Excel VBA and really want to fully transition my applications to Sheets.
1. determine if a filter has been set on a sheet
2. what the filter parameters are (so I could return the sheet the the original state)
3. clear a filter
4. set a filter with specific parameters
btw, I did this often in Excel VBA and really want to fully transition my applications to Sheets.
wa...@gmail.com <wa...@gmail.com> #39
Since ScriptDb is deprecated, we need filter or query functionality for spreadsheets.
ar...@trbls.com <ar...@trbls.com> #40
please implement this google. Thank you.
sk...@evergreens.com.ua <sk...@evergreens.com.ua> #41
Very-very important feature! Please, implement!
ar...@trbls.com <ar...@trbls.com> #42
still waiting. it is just the waste of the time.
ac...@gmail.com <ac...@gmail.com> #43
yes, im trying to create a filter view in the main sheets as opposed to the Data > Filter > Filter1 drop down menu. I think that it cant be that hard to implement since the actual operation is do able via a few clicks
an...@gmail.com <an...@gmail.com> #44
Filters are useless in a coded sheet if I can't AT LEAST apply a custom filter… Such a detail and yet so needed!
an...@gmail.com <an...@gmail.com> #45
[Comment deleted]
[Deleted User] <[Deleted User]> #46
ditto. Over two years waiting for this and also over two years waiting for google drive to implement an "inFolders:" search term. We definitely are wasting our time waiting. Next time I will actively oppose using google sheets or drive for any projects requiring more than BASIC storage/text editing.
dm...@gmail.com <dm...@gmail.com> #48
I also had problems with working with filtered data. I found that using copyTo with option contentOnly, will copy only the filtered data. then you can work on the copy.
al...@gmail.com <al...@gmail.com> #49
For me, setting a filter for a range in a spreadsheet via a script is a very important feature. Example: my wife doesn't have the time (or inclination) to learn how to filter on arbitrary search terms. In Excel, I just created a button called "Enter ..." which popped up a text entry box to enter the search string for a fixed column, and another button called "All" which cleared the filter and showed all rows. I would like to do the same in Sheets. I look forward to this requirement being met ;-)
c....@gmail.com <c....@gmail.com> #50
We have spend days of trying sub-optimal workarounds because setting filters through script is not supported. That would have been minutes if it was. +n where n=hours wasted
t2...@woolworths.com.au <t2...@woolworths.com.au> #51
I agree this is also a very important feature and would simplify coding work around requirements
t2...@woolworths.com.au <t2...@woolworths.com.au> #52
[Comment deleted]
ar...@trbls.com <ar...@trbls.com> #53
HI Google,
Just the simple reply. Are you going to implement methods in Google SCript to enable, disable the filter and to manipulate the filter views, like create the new one, change the active etc.
Are you working on this? Are there any plans to implement this?
Just the simple reply. Are you going to implement methods in Google SCript to enable, disable the filter and to manipulate the filter views, like create the new one, change the active etc.
Are you working on this? Are there any plans to implement this?
jo...@ascensoreslaplata.com.ar <jo...@ascensoreslaplata.com.ar> #54
"to manipulate the filter views, like create the new one, change the active etc."
Into etc. please consider delete stored filter views. Some users don't re use stored filter views and since the filters are stored if you give them a name or not, they accumulate into an hard to handle list. To manipulate them could allow to write a very useful FV manager.
Into etc. please consider delete stored filter views. Some users don't re use stored filter views and since the filters are stored if you give them a name or not, they accumulate into an hard to handle list. To manipulate them could allow to write a very useful FV manager.
[Deleted User] <[Deleted User]> #55
If simple and common functions such as .getValues() and setValue() can throw the error "This operation is not supported on a range with a filtered out row" (and they do!), then you simply *must* give us tools to test for those states.
Without the ability to check for reasonable conditions which are known to result in failed execution, it's impossible to build a reliable data-processing application.
Without the ability to check for reasonable conditions which are known to result in failed execution, it's impossible to build a reliable data-processing application.
ca...@whiting-turner.com <ca...@whiting-turner.com> #56
[Comment deleted]
ar...@trbls.com <ar...@trbls.com> #57
the solution is to go back to Excel and use
Excel.ActiveWorkbook.Worksheets(1).ListObjects(1).Range.AutoFilter
to disable all filters.
The new Excel 2013 has the ability to save files on cloud, the same way as google doing it.
We have been waiting for implementation of this function from Google for years so we decided that Excel alternative is better.
Hope this helps.
Cheers
Excel.ActiveWorkbook.Worksheets(1).ListObjects(1).Range.AutoFilter
to disable all filters.
The new Excel 2013 has the ability to save files on cloud, the same way as google doing it.
We have been waiting for implementation of this function from Google for years so we decided that Excel alternative is better.
Hope this helps.
Cheers
he...@google.com <he...@google.com> #58
Definitely +1. It would be very critical feature.
he...@gmail.com <he...@gmail.com> #59
まだかなーまだかなー
jo...@ascensoreslaplata.com.ar <jo...@ascensoreslaplata.com.ar> #60
Please, don't forget about this :-(
Filter views on protected ranges (where I expected that users with limited rights were able to filter) doesn't work, and if the editor creates filter views to be used as fixed filters, the range doesn't grow with the rows and limited range users can't change it neither.
I did my catharsis; sorry for this.
Filter views on protected ranges (where I expected that users with limited rights were able to filter) doesn't work, and if the editor creates filter views to be used as fixed filters, the range doesn't grow with the rows and limited range users can't change it neither.
I did my catharsis; sorry for this.
[Deleted User] <[Deleted User]> #61
Want to understand if the clearFilter(;)works or not. please help.
ar...@trbls.com <ar...@trbls.com> #62
please implement this. we employ 100 people and use google spreadsheets everyday. If someone sets the filter and if other forgets to 'select all' then we end up with situation like:
- we can find something using CTRL+F
- we end up with duplicated item. Because some of them are hidden people are adding same thing again.
We need to onOpen event have the possibility to clear all filters (set them to select all)
Google, Looking for some hits...
- we can find something using CTRL+F
- we end up with duplicated item. Because some of them are hidden people are adding same thing again.
We need to onOpen event have the possibility to clear all filters (set them to select all)
Google, Looking for some hits...
ad...@gmail.com <ad...@gmail.com> #63
I really struggle regularly with this issue. If a filter has been left on and I run code to find or hide rows in preparation for printing, I get the wrong result. I have to display a message box to remind to TURN OFF the filter, run the code, and then message box to turn filter back on. Very error prone, messy and inefficient. Would love a solution at least allowing to remove all filters!
an...@acronym.com <an...@acronym.com> #64
[Comment deleted]
et...@gmail.com <et...@gmail.com> #65
I am amazed that after more than four years, this important item still has a medium priority status. Google, please, listen to your customers!
[Deleted User] <[Deleted User]> #66
Seriously...enough is enough! At a minimum, please provide methods to:
* check for active filters; and
* clear all filters
Without these basics, you can't build an application that will produce reliable, consistent results...in other words, you can only build toys.
Please, if we can't have .getActiveFilters() and associated tools to manipulate the returned filters, then start with the Boolean .filtersActive() and a simple .clearActiveFilters().
* check for active filters; and
* clear all filters
Without these basics, you can't build an application that will produce reliable, consistent results...in other words, you can only build toys.
Please, if we can't have .getActiveFilters() and associated tools to manipulate the returned filters, then start with the Boolean .filtersActive() and a simple .clearActiveFilters().
as...@gmail.com <as...@gmail.com> #67
Perhaps it's not 100% clear, since this is a very old thread, that this problem is literally a breaking bug in the new Sheets owing to the non-compatibility of filters with Range methods .copyTo(), .copyValuesToRange(), and copyFormatToRange().
The copyTo() method in particular is needed in many cases where formulas, data validations, and formats need to be extended to a range that may or may not have had filters applied to it by end users.
The rather embarrassing best practice in my organization, which manages and bulk-updates data in arrays of Spreadsheets for a large number of schools, had been to pay someone with a Masters degree to spend dozens of hours a month manually inspecting and unsetting all filters on Sheets that are being updated.
Thanks to the Masters degree, we've since discovered a breathtaking innovation, which involves a hidden properties sheet that holds a formula like =if(counta('Heat Map'!A:A)<>subtotal(3,'Heat Map'!A:A),"Yes","No") where the subtotal formula only applies to the visible rows, whereas counta applies to all. When there is a discrepancy between these two values, we know that a filter has been applied to the sheet. We now perform a check to determine if a filter is set prior to running any batch process, at which point we pay someone to manually unset filters on all the offending sheets.
Whereas the .getFilters(), .unsetFilters() etc. functionality used to be understood as an enhancement, this thread should be recategorized as a high priority bug, since the lack of compatibility between filters and multiple other sheets methods renders them almost useless.
The copyTo() method in particular is needed in many cases where formulas, data validations, and formats need to be extended to a range that may or may not have had filters applied to it by end users.
The rather embarrassing best practice in my organization, which manages and bulk-updates data in arrays of Spreadsheets for a large number of schools, had been to pay someone with a Masters degree to spend dozens of hours a month manually inspecting and unsetting all filters on Sheets that are being updated.
Thanks to the Masters degree, we've since discovered a breathtaking innovation, which involves a hidden properties sheet that holds a formula like =if(counta('Heat Map'!A:A)<>subtotal(3,'Heat Map'!A:A),"Yes","No") where the subtotal formula only applies to the visible rows, whereas counta applies to all. When there is a discrepancy between these two values, we know that a filter has been applied to the sheet. We now perform a check to determine if a filter is set prior to running any batch process, at which point we pay someone to manually unset filters on all the offending sheets.
Whereas the .getFilters(), .unsetFilters() etc. functionality used to be understood as an enhancement, this thread should be recategorized as a high priority bug, since the lack of compatibility between filters and multiple other sheets methods renders them almost useless.
ev...@gmail.com <ev...@gmail.com> #68
+1 #6 especially for me. This functionality would create a lot of value for me for such a simple task.
ev...@gmail.com <ev...@gmail.com> #69
+1 #6 especially for me. This functionality would create a lot of value for me for such a simple task.
ar...@trbls.com <ar...@trbls.com> #70
it is worth to mentioned that both filter and custom filter views need to have these method implemented. In our organization we use custom filter views, so the screen of other users doesn't 'blink'
Anyway, please integrate the functionality of Filters and Filters views with Api Script.
It would be very useful to have the functions called
.createNewFilterView(nameOfTheFilter)
.renameActiveFilterView(newName)
.activateFilterView(nameOfTheFilter)//not sure what to do with filters with same name
.updateRangeOfActiveFilterView()
.deleteActiveFilterView()
.filterViewDisable()
.filter(onOrOff)
.doFilter(columnNumber,filterText) //filter text =="" to select all
Please implement these method as they are critical for our organization.
thanks
Anyway, please integrate the functionality of Filters and Filters views with Api Script.
It would be very useful to have the functions called
.createNewFilterView(nameOfTheFilter)
.renameActiveFilterView(newName)
.activateFilterView(nameOfTheFilter)//not sure what to do with filters with same name
.updateRangeOfActiveFilterView()
.deleteActiveFilterView()
.filterViewDisable()
.filter(onOrOff)
.doFilter(columnNumber,filterText) //filter text =="" to select all
Please implement these method as they are critical for our organization.
thanks
ml...@gmail.com <ml...@gmail.com> #71
I agree totaly:
.activateFilterView would be very appreciated !!!!!!
and others function around the filtered view
Thank you in advance
.activateFilterView would be very appreciated !!!!!!
and others function around the filtered view
Thank you in advance
sf...@gmail.com <sf...@gmail.com> #72
I agree, this is a must.
Any workaround for this for now?
Any workaround for this for now?
ad...@gmail.com <ad...@gmail.com> #73
YES PLEASE
mz...@gmail.com <mz...@gmail.com> #74
.getFilteredRows() would enhance our add-on enormously!! Any temporary workarounds available?
be...@gmail.com <be...@gmail.com> #75
Our add-on have lots of users who are requesting this feature.
Is there anything we can do except wait? A workaround?
Is there anything we can do except wait? A workaround?
ma...@vinodgubbala.com <ma...@vinodgubbala.com> #76
I am also waiting for this for a long time.
ar...@trbls.com <ar...@trbls.com> #77
you can wait forever and Google don't even tell you what they are after.
[Deleted User] <[Deleted User]> #78
I have created a workaround. Take a look at https://gist.github.com/carlbergman/1a1dd786425bc9180b29
The workaround abuses the fact that you can only change the font color on non-filtered cells.
If you use this workaround it would be wise to keep track of issue 36761726 : https://code.google.com/p/google-apps-script-issues/issues/detail?id=3981
The workaround abuses the fact that you can only change the font color on non-filtered cells.
If you use this workaround it would be wise to keep track of
da...@gmail.com <da...@gmail.com> #79
@ #79 clever and nifty. Thanks.
ar...@trbls.com <ar...@trbls.com> #80
so what the workaround actually does? Sets the font? I want functions enableFilter or disableFilter, isEnabled?
[Deleted User] <[Deleted User]> #81
@ #81: The workaround does the following:
1. Gets the font colors of a range.
2. Changes the font colors of a range.
3. Gets the font colors of the same range.
4. Changes the font colors back to the initial colors.
In step 3 we can see which cells were filtered. Only non-filtered cells have changed font color. My method stores the values from non-filtered cells in an array, because it suits my use case.
It can probably be modified to OP's .getFilteredRows() and it's only a slight modification of OP's .getFilteredValues(). I'm afraid it can't be used for the rest of the use cases.
1. Gets the font colors of a range.
2. Changes the font colors of a range.
3. Gets the font colors of the same range.
4. Changes the font colors back to the initial colors.
In step 3 we can see which cells were filtered. Only non-filtered cells have changed font color. My method stores the values from non-filtered cells in an array, because it suits my use case.
It can probably be modified to OP's .getFilteredRows() and it's only a slight modification of OP's .getFilteredValues(). I'm afraid it can't be used for the rest of the use cases.
ju...@gmail.com <ju...@gmail.com> #82
I think that this function would be greatly useful
tb...@gmail.com <tb...@gmail.com> #83
Another useful method not mentioned in the request or in any of the comments is reapplyFilter(), to simply cause a re-filtering of the rows, so it can be invoked in an onEdit() method. The ability to change filters is great, but since editing doesn't re-apply the filter, there needs to be a method to allow you to do that.
ca...@whiting-turner.com <ca...@whiting-turner.com> #84
[Comment deleted]
ch...@gmail.com <ch...@gmail.com> #85
This functionality would be very useful.
c....@gmail.com <c....@gmail.com> #86
Yes, just re-apply would be just enough, because now we have conditional filters. We just need a way of programmatically re-applying the existing filters.
ar...@trbls.com <ar...@trbls.com> #87
YOU WILL WAIT ANOTHER 5 YEARS TO GET THIS IMPLEMENTED. Google doesn't even bother to update its release notes:
https://developers.google.com/apps-script/releases/
Last update took 3 months ago.
Last update took 3 months ago.
[Deleted User] <[Deleted User]> #88
I would love this feature!
il...@newvisions.org <il...@newvisions.org> #89
Please prioritize this issue Google! We have been waiting for 4 years!
[Deleted User] <[Deleted User]> #90
I just can't figure out how Google didn't provide this feature yet!
It's so necessary, so obvious.
It's so necessary, so obvious.
ar...@trbls.com <ar...@trbls.com> #91
Hi google, can you at least tell us whether this will be implemented or not?
pr...@gmail.com <pr...@gmail.com> #92
that's important also for me! many thanks developers!
[Deleted User] <[Deleted User]> #93
GOOGLE DEVELOPERS this feature is being requested by many of your users, WILL WE GET AN ANSWER?
on...@gmail.com <on...@gmail.com> #94
This is a must. Please add this feature.
[Deleted User] <[Deleted User]> #95
Thus feature would make things easier please help
[Deleted User] <[Deleted User]> #96
Please Add this feature
ad...@hopbrookcc.com <ad...@hopbrookcc.com> #97
I want this feature as well, specifically setFilter()
si...@gmail.com <si...@gmail.com> #98
I would even settle for sheet.refreshFilter() as values changed by a script will not be reflected in an existing filter unless manually refreshed by the user
fr...@westbeach.com <fr...@westbeach.com> #99
Adding my voice to the crowd here. I just spent a while trying to figure out how to get user filter criteria, assuming that it would be possible... and ended up here. I'm surprised this has not been addressed given the demand! Any info please google?
[Deleted User] <[Deleted User]> #100
It would be great to have sheet.enableFilter(). Set it off and on to clear the criteria for the filters.
Filter Dropdown -> Select all -> OK (Repeat for multiple criteria)
Doing this is very annoying.
Filter Dropdown -> Select all -> OK (Repeat for multiple criteria)
Doing this is very annoying.
he...@fuw.org.uk <he...@fuw.org.uk> #101
Please get the filters available in scripts Google - I was very disappointed to find you can't do it yet.
[Deleted User] <[Deleted User]> #102
Yes please
in...@gmail.com <in...@gmail.com> #103
Yes please, make it ASAP.
br...@gmail.com <br...@gmail.com> #104
Yes please
ky...@gmail.com <ky...@gmail.com> #105
Please
da...@gmail.com <da...@gmail.com> #106
in...@gmail.com <in...@gmail.com> #107
Please fix :)
em...@gmail.com <em...@gmail.com> #108
Really need this functionality, although I would like to see ability to turn on and off view-filters too.
ar...@gmail.com <ar...@gmail.com> #109
Yes, sending emails to Filtered rows help us tremendously. Please help.
ts...@ciyh.co.uk <ts...@ciyh.co.uk> #110
I really need the ability to update the view to remove recently added rows from the currently active filter.
ke...@barronltg.com <ke...@barronltg.com> #111
this would be awesome!
xi...@bc.edu <xi...@bc.edu> #112
Yes, this functionality would rock! Please implement!
st...@gmail.com <st...@gmail.com> #113
Absolutely! Please! :)
in...@saidattanj.org <in...@saidattanj.org> #114
Yes, sending emails to Filtered rows will help very much !
qu...@gmail.com <qu...@gmail.com> #115
That's very useful! plase do it! many thanks,
Igor Fiorini
Igor Fiorini
in...@morvanremorques.fr <in...@morvanremorques.fr> #116
Yes, please add. At least ability to determine if filter active. Had an issue today caused by lack of this.
in...@morvanremorques.fr <in...@morvanremorques.fr> #117
[Comment deleted]
se...@gmail.com <se...@gmail.com> #118
I definitely need to filter rows for massive emailings.
he...@jasondainter.com <he...@jasondainter.com> #119
Please add this!
rf...@gmail.com <rf...@gmail.com> #120
Google,
At a minimum, even partial, non-controversial functionality would be immensely helpful. The most common use-case seems to be just to be able to de-activate all filters.
Please consider at least doing .DeactivateFilters()
At a minimum, even partial, non-controversial functionality would be immensely helpful. The most common use-case seems to be just to be able to de-activate all filters.
Please consider at least doing .DeactivateFilters()
za...@gmail.com <za...@gmail.com> #121
Dear Google, Please add this feature.
al...@temet.ch <al...@temet.ch> #122
I also need this feature, at least to deactivate the filter. I use the Sheets API to write to user accessible sheets, and if someone sets an autofilter, the writes are ignored. Which means a manual correction whenever somebody uses an autofilter-
[Deleted User] <[Deleted User]> #123
This feature would be great to have
sa...@gmail.com <sa...@gmail.com> #124
How long will this take to be available?
This is a must if you want to merge spreadsheet data into documents (i.e. print reports, labels, lists) and you need to filter the printed data
This is a must if you want to merge spreadsheet data into documents (i.e. print reports, labels, lists) and you need to filter the printed data
[Deleted User] <[Deleted User]> #125
This is a must. Add and Remove Filters from Cells are a must!
ho...@gmail.com <ho...@gmail.com> #126
[Comment deleted]
ho...@gmail.com <ho...@gmail.com> #127
It would be a huge help if this is available
ma...@york.ac.uk <ma...@york.ac.uk> #128
Dear Google Dev,
Please implement a set of basic filter functions!
sheet.setFilter()
sheet.removeFilter()
sheet.getFilterRange()
Thank you,
Matt Hodges
Please implement a set of basic filter functions!
sheet.setFilter()
sheet.removeFilter()
sheet.getFilterRange()
Thank you,
Matt Hodges
lu...@gmail.com <lu...@gmail.com> #129
I would like to get data as seen in a filter view.
I.e. I have a filter view that has the data alphabetical, or a subset of data, and I want to easily work on that without having to re-implement the filtering in Apps Script.
I.e. I have a filter view that has the data alphabetical, or a subset of data, and I want to easily work on that without having to re-implement the filtering in Apps Script.
ad...@centrallocal.org <ad...@centrallocal.org> #130
This needs fixed asap. I can't even append a row to a spreadsheet with a script if the data filter is on. That means I can't automate my project. I need to be able to clear all filters before it runs.
Please create these functions, I can't believe the wait time on this project.
sheet.setFilter()
sheet.removeFilter()
Please create these functions, I can't believe the wait time on this project.
sheet.setFilter()
sheet.removeFilter()
al...@gmail.com <al...@gmail.com> #131
We all need it!
vi...@gmail.com <vi...@gmail.com> #132
It's a must to have this...
ri...@autovance.com <ri...@autovance.com> #133
Any update on this? I'm really struggling to understand why this hasn't been implemented.
ph...@incisive.org <ph...@incisive.org> #134
I also would like this function
ik...@jig.jp <ik...@jig.jp> #135
[Comment deleted]
jo...@aanscharius.com <jo...@aanscharius.com> #136
It is so simple to implement, why don't they?
Every menu action should have to be possible to handle by a separate button, which refers via a script to a certain menu.
Something like applymenu(6;8;2) which in this case would be applying a certain filterview. Imagine what you could do, this is SO MUCH MORE.
Of course, if versions change, it could be your reference to a menu doesn't work anymore. But I would not bother to update, if google sheets is updated.
Every menu action should have to be possible to handle by a separate button, which refers via a script to a certain menu.
Something like applymenu(6;8;2) which in this case would be applying a certain filterview. Imagine what you could do, this is SO MUCH MORE.
Of course, if versions change, it could be your reference to a menu doesn't work anymore. But I would not bother to update, if google sheets is updated.
ma...@neverland.com.ar <ma...@neverland.com.ar> #137
5 years and not even an acknowledgment from google?
ro...@gmail.com <ro...@gmail.com> #138
The new Sheets API (V4), presented at Google I/O 2016, provides support to get & set filters on a sheet (both basic filter & filtered views).
It's possible to call this API from Apps Script (via UrlFetch). Here's an example:
https://script.google.com/d/1MXxVLPUEQF9s9L3uzJ5dTn4W5ur8yUn15dR7Y_yzUzClHyAjnmdBDCvn/edit?usp=sharing
(note that it works like an Advanced Service, you need to activate the API in the Developers Console Project).
Bruce Mcpherson built an Apps Script library to get filtered values from a sheet:
http://ramblings.mcpher.com/Home/excelquirks/exceldocsintegration/filters
This library will be updated later on to support the ability to set or delete filters on a sheet.
Code source is available on GitHub -https://github.com/brucemcpherson/SheetsMore
It's possible to call this API from Apps Script (via UrlFetch). Here's an example:
(note that it works like an Advanced Service, you need to activate the API in the Developers Console Project).
Bruce Mcpherson built an Apps Script library to get filtered values from a sheet:
This library will be updated later on to support the ability to set or delete filters on a sheet.
Code source is available on GitHub -
[Deleted User] <[Deleted User]> #139
wow thank you. will have a pop at this ;-)
jo...@ascensoreslaplata.com.ar <jo...@ascensoreslaplata.com.ar> #140
For those who may find a way to delete filter views and turn basic filter off useful, check the following stackoverflow entry https://goo.gl/1EalGQ
[Deleted User] <[Deleted User]> #141
These most recent solutions described in #139 and #141 do not work for me, as the sheet will not allow the deletion of rows that contain form questions. It would be great if google implemented a GAS native solution for this.
jo...@trans-plus.com <jo...@trans-plus.com> #142
[Comment deleted]
jo...@trans-plus.com <jo...@trans-plus.com> #143
update #139 proposed solution not working, returning error
Request failed forhttps://sheets.googleapis.com/v4/spreadsheets/xx[MY SHEET SSID]xx?fields=sheets%2FbasicFilter returned code 400. Truncated server response: { "error": { "code": 400, "message": "Client project not found. Please pass a valid project.", "status": "INVALID_ARGUMENT", "det... (use muteHttpExceptions option to examine full response)
Request failed for
kr...@gmail.com <kr...@gmail.com> #144
please implement this google. Thank you.
co...@gustinquon.com <co...@gustinquon.com> #145
[Comment deleted]
sl...@gmail.com <sl...@gmail.com> #146
Please implement
ev...@gmail.com <ev...@gmail.com> #147
S'il vous plait, pretty please!!
[Deleted User] <[Deleted User]> #148
This would be a powerful tool to let us programmatically edit/enable filter views. really still needed.
ro...@gmail.com <ro...@gmail.com> #149
Yes, it would be very very interesting to have the possibility to set filters programmatically.
pe...@gmail.com <pe...@gmail.com> #150
Please implement
ba...@cactusauto.com <ba...@cactusauto.com> #151
I am in disbelief that this portion of the api is in the feature requests trash bin, and not on the apps script reference page.
j....@nubalia.com <j....@nubalia.com> #152
I can hardly believe such a basic feature is still being ignored after so many years.
ja...@gmail.com <ja...@gmail.com> #153
Please listen to us and add a way to clear a filter in a sheet before other code tries to run on it.
jo...@gmail.com <jo...@gmail.com> #154
I really need the function to clear all filters before manipulating the data.
[Deleted User] <[Deleted User]> #155
incredible six years and nothing
ma...@neverland.com.ar <ma...@neverland.com.ar> #156
Some 'Issue tracker'. We'd have better luck asking for this on 4chan.
ro...@gmail.com <ro...@gmail.com> #157
You can use the new Google Sheets advanced service to get the filtered rows, clear all filters,...
See this blog post for more info:
https://gsuite-developers.googleblog.com/2017/04/using-google-sheets-filters-in-add-ons.html
function getIndexesOfFilteredRows(ssId, sheetId) {
var hiddenRows = [];
// limit what's returned from the API
var fields = "sheets(data(rowMetadata(hiddenByFilter)),properties/sheetId)";
var sheets = Sheets.Spreadsheets.get(ssId, {fields: fields}).sheets;
for (var i = 0; i < sheets.length; i++) {
if (sheets[i].properties.sheetId == sheetId) {
var data = sheets[i].data;
var rows = data[0].rowMetadata;
for (var j = 0; j < rows.length; j++) {
if (rows[j].hiddenByFilter) hiddenRows.push(j);
}
}
}
return hiddenRows;
}
See this blog post for more info:
function getIndexesOfFilteredRows(ssId, sheetId) {
var hiddenRows = [];
// limit what's returned from the API
var fields = "sheets(data(rowMetadata(hiddenByFilter)),properties/sheetId)";
var sheets = Sheets.Spreadsheets.get(ssId, {fields: fields}).sheets;
for (var i = 0; i < sheets.length; i++) {
if (sheets[i].properties.sheetId == sheetId) {
var data = sheets[i].data;
var rows = data[0].rowMetadata;
for (var j = 0; j < rows.length; j++) {
if (rows[j].hiddenByFilter) hiddenRows.push(j);
}
}
}
return hiddenRows;
}
ar...@trbls.com <ar...@trbls.com> #158
great mate, That is what I wanted.
ry...@google.com <ry...@google.com> #159
As mentioned in #157, it is possible to access and edit filters using the Sheets Advanced Service. The functionality does not exist in the regular Sheets service at this time, so we will keep this feature request open for now.
ki...@gmail.com <ki...@gmail.com> #160
Kh...@tlpk.com <Kh...@tlpk.com> #161
Yes, I want to add a code on sheet open i.e.
if (email == 'abc@gmail.com' )
sheet.setFilter('SalesView')
if (email == 'abc@gmail.com' )
sheet.setFilter('SalesView')
ki...@gmail.com <ki...@gmail.com> #162
et...@gmail.com <et...@gmail.com> #163
Man, (ki...@gmail.com)
Just read the emails you get through the end!
Two hint :
- you only need one second of thinking and two clicks to get peace of mind by yourself!!!
- Google must admit that the mouseover tip might be counterintuitive at first reading for some poeple.
Lets go : give it a try!
Just read the emails you get through the end!
Two hint :
- you only need one second of thinking and two clicks to get peace of mind by yourself!!!
- Google must admit that the mouseover tip might be counterintuitive at first reading for some poeple.
Lets go : give it a try!
ki...@gmail.com <ki...@gmail.com> #164
et...@gmail.com <et...@gmail.com> #165
Sorry, I forgot to Google, that this is still an urgent need!!!
jp...@gmail.com <jp...@gmail.com> #166
ki... please go to https://issuetracker.google.com/issues/36753410 and click the little up left star.
et... please be nice :-p
et... please be nice :-p
ki...@gmail.com <ki...@gmail.com> #167
I have used the unstar function several times but still get updates....
when I search for started items, it doesn't even show up but I am still
receiving all this.
Maybe the team could remove my email from those conversations?
On May 13, 2017 11:14 AM, <buganizer-system@google.com> wrote:
when I search for started items, it doesn't even show up but I am still
receiving all this.
Maybe the team could remove my email from those conversations?
On May 13, 2017 11:14 AM, <buganizer-system@google.com> wrote:
[Deleted User] <[Deleted User]> #168
First of all, thank you Google Dev's for finally resolving this issue! :) As for all of you wishing to unsubscribe from this issue, try this: head over to the "Starred by me" section in the left panel, once there look for this issue in the mail panel and select it, finally tick "Un-Cc me" in the E-mail drop-down. Not sure if that will work, but it's worth a try.
ja...@gmail.com <ja...@gmail.com> #169
I just want to clear any filter a user has left applied on a Google Sheet before Apps Script code pulls in data from a database. I see examples of how to set a filter, but how do you simply clear a filter?
ja...@gmail.com <ja...@gmail.com> #171
Thanks. Yes we've seen that workaround, but in our situation we have a lot
of reports with multiple sheets which sometimes have different numbers of
header rows due to total formulas being at the top so that when a user
filters, they can see the resulting total from the columns they filtered.
Our hope was that this new Sheets API filter function would enable us to
simply clear all filters on a sheet before the data was pulled in from our
database nightly.
On Thu, May 18, 2017 at 12:16 AM, <buganizer-system@google.com> wrote:
of reports with multiple sheets which sometimes have different numbers of
header rows due to total formulas being at the top so that when a user
filters, they can see the resulting total from the columns they filtered.
Our hope was that this new Sheets API filter function would enable us to
simply clear all filters on a sheet before the data was pulled in from our
database nightly.
On Thu, May 18, 2017 at 12:16 AM, <buganizer-system@google.com> wrote:
ro...@gmail.com <ro...@gmail.com> #172
Here's how to clear all filters on a given sheet, using the new Sheets Advanced Service.
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);
}
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);
}
ja...@gmail.com <ja...@gmail.com> #173
Thank You, thank you, thank you!
On Thu, May 18, 2017 at 7:18 AM, <buganizer-system@google.com> wrote:
On Thu, May 18, 2017 at 7:18 AM, <buganizer-system@google.com> wrote:
ar...@trbls.com <ar...@trbls.com> #174
'clearFilter' function turns off filter. How can I leave the filters on but 'select all' items so there are none rows hidden?
ro...@gmail.com <ro...@gmail.com> #175
Like that:
function resetFilter() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var ssId = ss.getId();
var dataSheet = ss.getActiveSheet();
var lastRow = dataSheet.getLastRow();
var lastColumn = dataSheet.getLastColumn();
var sheetId = dataSheet.getSheetId();
var filterSettings = {
"range": {
"sheetId": sheetId,
"startRowIndex": 0,
"endRowIndex": lastRow,
"startColumnIndex": 0,
"endColumnIndex": lastColumn
}
};
var requests = [{
"setBasicFilter": {
"filter": filterSettings
}
}];
Sheets.Spreadsheets.batchUpdate({'requests': requests}, ssId);
}
function resetFilter() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var ssId = ss.getId();
var dataSheet = ss.getActiveSheet();
var lastRow = dataSheet.getLastRow();
var lastColumn = dataSheet.getLastColumn();
var sheetId = dataSheet.getSheetId();
var filterSettings = {
"range": {
"sheetId": sheetId,
"startRowIndex": 0,
"endRowIndex": lastRow,
"startColumnIndex": 0,
"endColumnIndex": lastColumn
}
};
var requests = [{
"setBasicFilter": {
"filter": filterSettings
}
}];
Sheets.Spreadsheets.batchUpdate({'requests': requests}, ssId);
}
ar...@trbls.com <ar...@trbls.com> #176
you are the hero! thank you
do...@lawsonweb.org <do...@lawsonweb.org> #177
#175 shows you how to reset a filter but can someone show how you can filter a particular column for a specific string?
ro...@gmail.com <ro...@gmail.com> #178
Sure, here's an example, where "columnIndex" is your particular column and "hiddenValues" your specific string.
I've compiled all code snippets here:
https://sites.google.com/site/scriptsexamples/learn-by-example/google-sheets-api/filters
function setFilter() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var filterSettings = {};
// The range of data on which you want to apply the filter.
// optional arguments: startRowIndex, startColumnIndex, endRowIndex, endColumnIndex
filterSettings.range = {
sheetId: ss.getActiveSheet().getSheetId()
};
// Criteria for showing/hiding rows in a filter
//https://developers.google.com/sheets/api/reference/rest/v4/FilterCriteria
filterSettings.criteria = {};
var columnIndex = 2;
filterSettings['criteria'][columnIndex] = {
'hiddenValues': ["England", "France"]
};
var request = {
"setBasicFilter": {
"filter": filterSettings
}
};
Sheets.Spreadsheets.batchUpdate({'requests': [request]}, ss.getId());
}
I've compiled all code snippets here:
function setFilter() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var filterSettings = {};
// The range of data on which you want to apply the filter.
// optional arguments: startRowIndex, startColumnIndex, endRowIndex, endColumnIndex
filterSettings.range = {
sheetId: ss.getActiveSheet().getSheetId()
};
// Criteria for showing/hiding rows in a filter
//
filterSettings.criteria = {};
var columnIndex = 2;
filterSettings['criteria'][columnIndex] = {
'hiddenValues': ["England", "France"]
};
var request = {
"setBasicFilter": {
"filter": filterSettings
}
};
Sheets.Spreadsheets.batchUpdate({'requests': [request]}, ss.getId());
}
mj...@mtu.edu <mj...@mtu.edu> #179
I have an application this would work wonderful on since filter views are not compatible with ANDROID/Iphone mobile apps!
da...@vli.lt <da...@vli.lt> #180
I am trying to run a script and got this: ReferenceError: "Sheets" is not defined. (line 25, file "Code"). Could somebody tell me how to solve this?
[Deleted User] <[Deleted User]> #181
Same error
ReferenceError: "Sheets" is not defined
ReferenceError: "Sheets" is not defined
ro...@diversey.com <ro...@diversey.com> #182
ReferenceError: "Sheets" is not defined. (line 25, file "Code").
go to Resources, then "Advanced Google Services", locate "Google Sheets API and enable.
also, go tohttps://console.cloud.google.com/apis/dashboard and enable "Sheets API"
go to Resources, then "Advanced Google Services", locate "Google Sheets API and enable.
also, go to
ac...@gmail.com <ac...@gmail.com> #183
Must thing!!!
[Deleted User] <[Deleted User]> #184
<purged>
is...@gmail.com <is...@gmail.com> #185
When is this going to be implemented for consumer users of sheets/apps script?
[Deleted User] <[Deleted User]> #186
Steps to get the Advanced Google Services working, and avoid the ReferenceError: "Sheets" is not defined. (line 25, file "Code"). error:
1) you need to follow all of the steps to enable Advanced Google Services. I wrote a quick blog post to help illustrate all the steps, because it's really easy to overlook one or another.
https://www.questionabledecisionmaking.com/blog/2018/1/5/scripting-google-sheets-filters
1) you need to follow all of the steps to enable Advanced Google Services. I wrote a quick blog post to help illustrate all the steps, because it's really easy to overlook one or another.
sh...@gmail.com <sh...@gmail.com> #187
#172 How do I do that on every sheet in the workbook? I want it to work on every sheet present in the workbook
tu...@gmail.com <tu...@gmail.com> #188
I need reflesh filtered data automaticly
ek...@google.com <ek...@google.com> #189
Yesterday we released some new functionality that makes it possible to manipulate filters with Apps Script:
-https://developers.google.com/apps-script/reference/spreadsheet/range#createFilter()
-https://developers.google.com/apps-script/reference/spreadsheet/sheet#getfilter
-https://developers.google.com/apps-script/reference/spreadsheet/filter
Unfortunately Apps Script still doesn't have methods for determining if a given row or column is hidden by the filter. See comment #157 for a workaround utilizing the Sheets Advanced Service.
-
-
-
Unfortunately Apps Script still doesn't have methods for determining if a given row or column is hidden by the filter. See
[Deleted User] <[Deleted User]> #190
Still a wonderful advance -- thank you!
mu...@gmail.com <mu...@gmail.com> #191
How do I remove my e-mail from this?
[Deleted User] <[Deleted User]> #192
First off: Thanks. This will be helpful.
What's the easiest method to simply refresh a current filter?
Do we have to iterate through each column, get it's filter criteria, and - if not null - set it's filter criteria to the same thing?
Is there a plan to add a filter.refresh() method in the future?
What's the easiest method to simply refresh a current filter?
Do we have to iterate through each column, get it's filter criteria, and - if not null - set it's filter criteria to the same thing?
Is there a plan to add a filter.refresh() method in the future?
sc...@gmail.com <sc...@gmail.com> #193
#175 posted the following:
function resetFilter() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var ssId = ss.getId();
var dataSheet = ss.getActiveSheet();
var lastRow = dataSheet.getLastRow();
var lastColumn = dataSheet.getLastColumn();
var sheetId = dataSheet.getSheetId();
var filterSettings = {
"range": {
"sheetId": sheetId,
"startRowIndex": 0,
"endRowIndex": lastRow,
"startColumnIndex": 0,
"endColumnIndex": lastColumn
}
};
var requests = [{
"setBasicFilter": {
"filter": filterSettings
}
}];
Sheets.Spreadsheets.batchUpdate({'requests': requests}, ssId);
}
My questions is.... where do I enter the stuff specific to my spreadsheet. I'm just learning to create buttons on spreadsheets, but I've never learned coding. Can someone just highlight the spots I need to enter stuff specific to my sheets. Also, is there a good resource for learning more about this? I got my first button to work yesterday and I'm in love.
function resetFilter() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var ssId = ss.getId();
var dataSheet = ss.getActiveSheet();
var lastRow = dataSheet.getLastRow();
var lastColumn = dataSheet.getLastColumn();
var sheetId = dataSheet.getSheetId();
var filterSettings = {
"range": {
"sheetId": sheetId,
"startRowIndex": 0,
"endRowIndex": lastRow,
"startColumnIndex": 0,
"endColumnIndex": lastColumn
}
};
var requests = [{
"setBasicFilter": {
"filter": filterSettings
}
}];
Sheets.Spreadsheets.batchUpdate({'requests': requests}, ssId);
}
My questions is.... where do I enter the stuff specific to my spreadsheet. I'm just learning to create buttons on spreadsheets, but I've never learned coding. Can someone just highlight the spots I need to enter stuff specific to my sheets. Also, is there a good resource for learning more about this? I got my first button to work yesterday and I'm in love.
ba...@gmail.com <ba...@gmail.com> #194
+1
co...@gmail.com <co...@gmail.com> #195
We need a clear filter option in the menu and with a keyboard shortcut ASAP!!!!!
da...@gmail.com <da...@gmail.com> #196
Is this now possible or not?
Like this:
onOpen()
{
switchToFilterView('filterName');
}
Like this:
onOpen()
{
switchToFilterView('filterName');
}
jb...@google.com <jb...@google.com> #197
ra...@pwc.com <ra...@pwc.com> #198
Need a way to clear all filters, it is time consuming when working on large spreadsheet to go through and clear each filter to "Select All", unlike Excel where you can clear all filters with the click of a button.
jb...@google.com <jb...@google.com> #199
#198 - Rachael: Here is some sample code that can do that:
// @OnlyCurrentDoc
function onOpen() {
SpreadsheetApp.getUi().createMenu("Filters").addItem("Clear all filters", "clearFilters").addToUi();
}
function clearFilters() {
var filter = SpreadsheetApp.getActiveSheet().getFilter();
if (filter) {
for (var column = filter.getRange().getColumn(); column <= filter.getRange().getLastColumn(); ++column) {
filter.removeColumnFilterCriteria(column);
}
}
}
// @OnlyCurrentDoc
function onOpen() {
SpreadsheetApp.getUi().createMenu("Filters").addItem("Clear all filters", "clearFilters").addToUi();
}
function clearFilters() {
var filter = SpreadsheetApp.getActiveSheet().getFilter();
if (filter) {
for (var column = filter.getRange().getColumn(); column <= filter.getRange().getLastColumn(); ++column) {
filter.removeColumnFilterCriteria(column);
}
}
}
jb...@google.com <jb...@google.com> #200
I believe that this request is done. New methods have been added for managing filters.
an...@cdp.net <an...@cdp.net> #201
Actually, there's still no way to delete unused filters, right?
My problem is that over time, in a shared Google Sheet, we have accumulated hundreds of filter views that are unused. There is no way to delete them in bulk.
The new methods only allow you to add/remove filters that are actually applied to the sheet, if I understand correctly
My problem is that over time, in a shared Google Sheet, we have accumulated hundreds of filter views that are unused. There is no way to delete them in bulk.
The new methods only allow you to add/remove filters that are actually applied to the sheet, if I understand correctly
jo...@ascensoreslaplata.com.ar <jo...@ascensoreslaplata.com.ar> #202
an... Workaround: check #140
[Deleted User] <[Deleted User]> #203
remove duplicates without installing an addon
rb...@salesforce.com <rb...@salesforce.com> #204
In Macros, While creating a filter if I use setHiddenValues method if tomorrow any new value comes, then that filter not gonna filter out the new value. It would be great if we have a method to set the filter not to hide. or is it already there? Please help.
la...@gmail.com <la...@gmail.com> #205
Please update the filter view everytime there new item added
lu...@gmail.com <lu...@gmail.com> #206
Would be very handy to have automated filtering whe n new item is added
we...@gmail.com <we...@gmail.com> #207
Oh yes please do this
el...@gmail.com <el...@gmail.com> #208
i agree!
v....@informatica.aci.it <v....@informatica.aci.it> #209
Hi this function is also important for me.
thank you
thank you
[Deleted User] <[Deleted User]> #210
Please add this functionality!
sa...@gmail.com <sa...@gmail.com> #211
Pl add this functionality.
ro...@one-line.com <ro...@one-line.com> #212
I agree!
[Deleted User] <[Deleted User]> #213
This would be great!
g....@leevingroup.com <g....@leevingroup.com> #214
That would be so useful
it...@evesarts.com <it...@evesarts.com> #215
Agree a very useful functionality
or...@gmail.com <or...@gmail.com> #216
Please, add this functionality
ro...@gmail.com <ro...@gmail.com> #217
Yes, it would be very useful!!!
ma...@verizon.com <ma...@verizon.com> #218
Mainly it would be super!
jl...@accoes.com <jl...@accoes.com> #219
Please add this feature. Thank you!
br...@gmail.com <br...@gmail.com> #220
I'd love this feature too!
li...@gmail.com <li...@gmail.com> #221
This shows as Status=Fixed.
Can someone point me to the documentation for the new functionality?
Can someone point me to the documentation for the new functionality?
rl...@redhat.com <rl...@redhat.com> #222
+1 -- would love this!
th...@gmail.com <th...@gmail.com> #223
Fixed, but not yet in Prod, it seems.
er...@veolia.com <er...@veolia.com> #224
please does th foncitonnality in place.
please implement this, basically it makes any sense to have filter which stay not automatically update? this is more a lack of dev than a nex fonctionnality required
.
thank you
please implement this, basically it makes any sense to have filter which stay not automatically update? this is more a lack of dev than a nex fonctionnality required
.
thank you
yo...@gmail.com <yo...@gmail.com> #225
function resetFilter() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var ssId = ss.getId();
var dataSheet = ss.getActiveSheet();
var lastRow = dataSheet.getLastRow();
var lastColumn = dataSheet.getLastColumn();
var sheetId = dataSheet.getSheetId();
var filterSettings = {
"range": {
"sheetId": sheetId,
"startRowIndex": 0,
"endRowIndex": lastRow,
"startColumnIndex": 0,
"endColumnIndex": lastColumn
}
};
var requests = [{
"setBasicFilter": {
"filter": filterSettings
}
}];
Sheets.Spreadsheets.batchUpdate({'requests': requests}, ssId);
}
I'm interested in this script, it does reset Basic Filter, is there anyway to do the same with the current filter views that we open?
Like for example, I open Filter 1 and it has filter value on columns B and D, with the similar script above can we achieve do the same so basically we just need to remove the filtered column and update the range on the top left?
du...@vrijclbdehavens.be <du...@vrijclbdehavens.be> #226
Please add this functionality. It would make it possible to create a user friendly sheet with multiple searchboxes, which each user can set without affecting the data viewed by another user and with the ability to edit the data on the same sheet. Above cannot be done with the query function of other functions with Google Sheets. We can use the slicer, but it cannot made as user friendly as filter views which, when made possible to code, could be used easily for users with the help of apps script.
Adding this functionality would be a big upgrade to Google Sheets, it would give the possibility to make a lot of workflows easier. Above can now only be done with a Webapp (but then lots of coding is required) or software like AppSheet, Airtable or MS Access.
Adding this functionality would be a big upgrade to Google Sheets, it would give the possibility to make a lot of workflows easier. Above can now only be done with a Webapp (but then lots of coding is required) or software like AppSheet, Airtable or MS Access.
du...@vrijclbdehavens.be <du...@vrijclbdehavens.be> #227
Why does this has the status "Fixed"? Can you please follow up on this functionality or provide some feedback? Thank you in advance!
ja...@gmail.com <ja...@gmail.com> #228
why does this say fixed?
It is not fixed at all.
Please fix the filters so they update automatically when you change the data.
It is not fixed at all.
Please fix the filters so they update automatically when you change the data.
er...@veolia.com <er...@veolia.com> #229
I m back , no news?
do not agree how it is "fixed"?
please answer?
do not agree how it is "fixed"?
please answer?
gl...@gmail.com <gl...@gmail.com> #230
Please add automatic filter update
qq...@gmail.com <qq...@gmail.com> #231
PLEASE ADD AUTOMATIC FILTER UPDATE
mo...@spektrum.de <mo...@spektrum.de> #232
>PLEASE ADD AUTOMATIC FILTER UPDATE
Please also implement this for filter views!
Please also implement this for filter views!
li...@gmail.com <li...@gmail.com> #233
Very confused about "Status = Fixed" on this one.
Anybody have any ideas?
Anybody have any ideas?
jo...@gmail.com <jo...@gmail.com> #234
same we need this pls google
li...@gmail.com <li...@gmail.com> #235
Does anybody understand why this is listed as "FIXED"?
Did something change?
Did something change?
su...@gscrd.com.br <su...@gscrd.com.br> #236
i dont know why the status its fix if nothing was made... I have created an macro and create an filterView, rename him, duplicate and delete. But in macro code only showed Spreadsheet().active() and an getRange with activated. i think this was not implemented. An way to create an filterView with app script will be very nice for who use app script and google sheets daily. Please google!
Description
From the perspective of using spreadsheets to support simple database applications, Tools/Filter is a very valuable tool. Better integration with google apps would greatly benefit everyone involved in using this platform.
1. .getFilteredRows() - return a 1d array of row nbrs in the current filter. Return all row nbrs if no filter is set. Return -1 if filter is not enabled
2. .getFilteredValues() - return a 2d array of rows/cols in the current filter. Return entire range if no filter is set. Return -1 is filter is not enabled
3. sheet.enableFilter(true) - equivalent to clicking Tools/Filter to enable filtering (no toggle unless we can tell if filters are active or not).
4. sheet.enableFilter(false) - equivalent to clicking Tools/Filter to disable filtering.
5. sheet.enableFilter() - return true if filter is enabled, false otherwise.
6. sheet.clearFilter() - clear current filter (if any) ... ie. display all records.
7. sheet.setFilter(..,...,...) - programmatically set filter based on criteria collected elsewhere by the application.
#1 is far and away the most important of the enhancements. If #1 is difficult and #2 is easier, then that would be my choice. If you only did #1 or #2, that is 95% in terms of importance.
Notes:
Here is an example from an application that i'm developing for my ski club.
Suppose we have a membership file that is stored on a spreadsheet. Suppose we have two applications: a formatted screen that supports add/change/delete/prev rec/next rec and an email 'blaster' that sends the same email message to a list of members.
File Maintenance - suppose we as asked to change data associated with a specific member whose last name is Moritz. The user can filter Last_Name = Moritz. Say there are two of them. She can then use Next Rec / Prev Rec to browse to the current record, change it and submit the change.
Email Blast - send an email to all active members advising them of a deadline to signup for a future ski trip. The user can filter for all active members.
Email Blast - send an email to all active members that haven't paid dues for coming year yet.