function get_data(value){
value = 1
var sheet = SpreadsheetApp.getActiveSheet()
var range = sheet.getRange(1, 1, sheet.getLastRow(), sheet.getLastColumn())
var filter = range.getFilter() || range.createFilter();
var foo_index = 1; // column A
var filterValue = SpreadsheetApp.newFilterCriteria().whenTextEqualTo(value).build()
filter.setColumnFilterCriteria(foo_index, filterValue)
// new code
var data = []
for (var i = 1; i < sheet.getLastRow(); i++) {
if(!sheet.isRowHiddenByFilter(i)) {
var row_data = sheet.getRange(i, 1, 1, sheet.getLastColumn()).getValues()
data.push(row_data[0])
}
}
// end new code
Logger.log(data)
return data
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter