Filter GSheet Data

52 views
Skip to first unread message

Linux_01

unread,
Mar 26, 2021, 1:16:22 AM3/26/21
to GAM for Google Workspace
Hello Team,

I want to filter out rows which are starting with any of the strings such as "Yes | yes | y | Y" from a GSheet and have a new GSheet with the filtered data.

Is it achievable using gam command?

Thank you.

Regards,
Linux_01

Brian Kim

unread,
Mar 26, 2021, 8:14:31 AM3/26/21
to GAM for Google Workspace

Simon Laycock

unread,
Mar 26, 2021, 2:49:09 PM3/26/21
to GAM for Google Workspace
Or even just a Query function.

Kim Nilsson

unread,
Mar 29, 2021, 11:15:08 AM3/29/21
to GAM for Google Workspace
AFAIK, it's currently not possible in gam.

The problem with your request, is that the gam spreadsheets commands wants the data to be in JSON format, which it usually isn't when you pull it from a sheet, or a local file.


I've talked to Ross about this a few times, and it's still on a longtime todo-maybe-never list. :-)

IF you could just download the rows in csv format to a local csv, and use csv...row_filter, then you could push that as a regular file upload to Drive.
When you then open the file in Drive it will be converted to a Sheets file.

gam create drivefile drivefilename "GoogleFile.csv" localfile "LocalFile.csv"


BUT, you can't. Any use of the current spreadsheet command will render your data in the LocalFile.csv in a single row in either JSON format or columns.
Both useless to my brain.

Also, afaik, there's no query when printing the data from a sheet, so you can't filter it.

So, pulling only some data from a sheet and pushing to another sheet isn't possible with gam.

Easiest (and most powerful) way is to use a manual IMPORTRANGE with a QUERY in your Spreadsheet2.

You can also use a filter, maybe after an importrange. Like this.

Gabriel Clifton

unread,
Mar 29, 2021, 11:18:42 AM3/29/21
to GAM for Google Workspace
In Sheets, for various filters like that, I use VLOOKUP. Very handy formula.
Reply all
Reply to author
Forward
0 new messages