tidyverse / googlesheets4

Google Spreadsheets R API (reboot of the googlesheets package)
https://googlesheets4.tidyverse.org
Other
360 stars 53 forks source link

gs4_create in folder of one's choice? #220

Closed dgmdevelopment closed 3 years ago

dgmdevelopment commented 3 years ago

Just wondering if gs4_create is able to write the sheet to a specific folder on google drive? It appears to only default to the root folder, so if not possible, perhaps this could be a feature request.
Thanks for an excellent package!

jennybc commented 3 years ago

The Sheets API cannot do this (create a new Sheet in a specific folder). So you have to create the Sheet with the Sheets API, then give it a specific parent directory via the the Drive API. In theory, googlesheets4 could wrap this up nicely, but it requires a more profound Sheets <--> Drive integration than we currently have and would require a more integrated approach to auth. So I will close this for now, because that's not imminent (but could happen one day).

Today, if you need to do this, you need to use googlesheets4 and googledrive together:

https://googlesheets4.tidyverse.org/articles/articles/drive-and-sheets.html

See https://googledrive.tidyverse.org/reference/drive_mv.html