My favorites | Sign in
Project Home Wiki Issues
New issue   Search
  Advanced search   Search tips   Subscriptions
Issue 195: Provide API to get the show/hide status of a row
89 people starred this issue and may be notified of changes. Back to list
Status:  Triaged
Owner:  ----

Sign in to add a comment
Reported by, Aug 3, 2010
Request Summary:

I am creating a spreadsheet tool that will process rows of data based on custom menu functions and change their visibility.  Being able to put the show/hide properties of a sheet into an array would be extremely helpful.  As a work around, I'm having to write out row numbers that I am making visible to another sheet and then retrieving them later as I employ the logic to show/hide the next set of rows.  This has its own problem of making the user see hundreds of sheet changes while the code executes, but that is a separate enhancement request.


Aug 4, 2010
Project Member #1 hgabreu
Well, from my understanding, if you are writing info to a sheet and then deleting them in the end, you can write them to an array object. Since the array can live as long as the script is running.
Sorry, if I didn't understood you well..
Aug 4, 2010
The tool I am working on is a scheduling spread sheet were each row is a deployment into a controlled environment.  The users want to run a custom menu command to only show those row that are scheduled for the next 7 days. After that script has been run, the user may want to run another script to further reduce the visible rows to only show Production deployments (in the next 7 days). After that script has been run, the user may want to run another script to show just the deployments assigned to a particular implementer (in the next 7 days, in the Production environment).  I have written a script with hard coded date ranges such as today()+7 as well as using the active cell contents to do a pattern match against all cells in the same column.

To make this work without the ability to determine the current visibility status of each row in a sheet, I'm having to write individual row numbers to a different sheet as the scripts determine which rows to hide.  An array would not work as each script will be executed independently and once the first script completes, the array will be lost.  
Sep 14, 2010
(No comment was entered for this change.)
Status: 2998878
Oct 4, 2010
(No comment was entered for this change.)
Feb 26, 2011
Project Member #5
(No comment was entered for this change.)
Apr 6, 2011
See discussion here:

Google recently added UI support to show/hide rows and sheets. We need API to use these in GAS.

My suggestions:

It would be great to have a hide(), show(), visible() method on the Sheet object.

hide() - Hides the sheet in the UI
show() - Unhides the sheet in the UI
visible() - returns true if the sheet is visible in the UI, false if not.

It would also be great to have a hideRow(n), showRow(n), and hiddenRows() methods too

hideRow(n) - Hides row N in the UI.
showRow(n) - Unhides row N in the UI.
hiddenRows() - returns an array of all hidden rows.
Sep 9, 2011
Had to rewrite a big piece of functionality in a script that shows/hides rows based on complicated criteria because it was issuing way too many calls to showrows/hiderows.

Since I couldn't get the visibility of the sheet's rows I had to iterate over each row in the sheet and either hide or show it. So for a sheet with N rows, I had N calls.

If there were a Sheet.getHiddenRows() (and getHiddenColumns too) method, I could have just toggled the rows I needed.

Big thanks to nmagocio for helping me with rewriting my script.
Jan 24, 2012
(No comment was entered for this change.)
Status: Triaged
Labels: log-2998878
Mar 2, 2013
This looks like a pretty old request. I am also looking for a method that can tell me if a row, column or cell is hidden or not.
Mar 23, 2013
I am also looking for this functionality.

There is a method Sheet#showColumns and a method Sheet#showRows [1]
I am looking for a way to know if a Column is hidden and another method to know if a row is hidden.

Is it possible to know this from a google-app-script?

Many thanks in advance.
Apr 26, 2013
I give my vote for a "getHiddenRows()" and "getHiddenColumns()" feature!
Jun 22, 2013
I would love to see this feature be available too!!!!!!!
Jul 20, 2013
Signed. Such a functionality would bring me (and many others as well) a great tools to use in my spreadsheet scripts.

Many thanks and good luck to the developers that could be involved in implementing such feature!
Jul 26, 2013
Please add this feature, would be a good addition to being able to make rows visible
Oct 4, 2013
#16 steven.pribilinskiy
My workaround was to use a special leading character that would indicate the visibility state of the row/column, it was a backtick (`), but then each show/hide column/row command should be performed from a customized menu.
Details are in the StackOverflow topic:
Oct 7, 2013
Good workaround.  If only I could rely on the guys here to consistently use alternate show/hide commands rather than right clicking and using the context menu to show/hide the rows.  Is there any way to block out the normal show/hide functionality for certain users?
Oct 7, 2013
#18 steven.pribilinskiy
It should be possible with some Browser Extensions, as it's a web application after all
Oct 7, 2013
Good thinking Steven.  I'll add it to the list and see what I can do to implement.  I'll let you guys know if I make any progress.
Feb 4, 2014
Another workaround is changing the width of hidden columns to the minimum of 2. You can then detect hidden columns by their width. This would only really work if you do not care about preserving the width of the column before it was hidden. Since you are hiding the column anyways, the column width might not be significant.
Feb 9, 2014
I would like to be able to test for the visibility of a row, so that I can avoid duplicating cells from a line but only if the line above is visible.
Apr 10, 2014
Owner: ---
Sign in to add a comment

Powered by Google Project Hosting