The following code fails in Google scripts:
var criteria = SpreadsheetApp.newFilterCriteria()
.setVisibleValues(["SuzieS","MaryA"])
.build();
with an exception that visible values are not supported. But this parameter is documented.
I would like to set only one value as visible, then use that as a method of removing all rows that have that visible value. Since the column might have many distinct values, I don't want to list a whole bunch of hidden values.
I don't see Google documentation on a bug or on anything else. Anyone know? Thanks in advance.
Addition: Yes, I did see the question had been posed before, but the answer was a workaround.
I was asked for furthr information. I set up a simple spreadsheet with plain-text numbers in cells A1 to A16. Then I ran the following standalone script:
function testVisible(){
var sheetR =
SpreadsheetApp.open(DriveApp.getFilesByName("TestSheet").next())
.getActiveSheet() ;
var newFilter = sheetR.getRange("A:A").createFilter();
var criteria =
SpreadsheetApp.newFilterCriteria().setVisibleValues(["1","4"]).build();
newFilter.setColumnFilterCriteria(1, criteria);
}
and got an exception error that setVisibleValues is not supported.