Appending output todrive+tofileid Google Sheet

177 views
Skip to first unread message

Rick Shangle

unread,
Aug 29, 2022, 3:39:25 PM8/29/22
to GAM for Google Workspace
(first-time poster; long-time respecter of the power of GAMADV. It's the only way to fly).

Is it possible to append GAMADV output to a Drive-resident Google sheet?

I have a gam command that is walking across the top directory level of a very large "user" (not really) account, because gam will puke on standard filelist unless we throw unreasonable memory sizes at it to run it all in one dump.

It does a filelist on each level=0 subdirectory, and I want it to append (CSV or Sheets; doesn't really matter to me) to a defined file, not overwrite. 

I originally wrote it to dump each level=0 subdirectory with the unique name of the subdirectory, but the way this mega-file is going to get processed would make stitching a bunch of Sheets together an unnecessary task if I can just append at the gam level. 

Thanks all. Keep up the awesome work. 

Rick

Rick Shangle

unread,
Aug 29, 2022, 6:50:59 PM8/29/22
to GAM for Google Workspace
To paraphrase an appreciated Google Meet session with Ross, I'm requesting a non-trivial thing. Hopefully I get the high points right:

1. When using the Sheets API to write (tdout...) there's currently no option in the Google API to append to a sheet; just overwrite, or add a new tab/worksheet. 

2) further exacerbating is the Harsh Reality of Google Drive's Infinitely Scalable and Indirect Permissions Model [1], which leads to the likelihood, if you don't explicitly/filter specific fields AND avoid requesting permissions as part of the output, the output columns will be different on a selected dataset-by-dataset basis.

Solution: 

Use "redirect csv...", which should work fine in this case, and pass some of the burden off to my data-wrangler development colleague to sort it out in PERL. 

Avoid requesting information on file/folder permissions unless it's, you know, of dire importance. 

Ask yourself why you're looking for them in the first place. What are you going to do with that info? 

Peace, 
Rick


[1] cool name for a band 
Reply all
Reply to author
Forward
0 new messages