Save a Google Sheet to Data Table

Hello,

Ultimately, I am trying duplicate & rename a Google sheet from my drive. I’m able to download/create xlsx but never Google sheet. All attempts at that have failed thus far, so I’m now pivoting my approach.

I would like save a Google sheet from my drive as a media object in my data table. From the data table, I would then name and upload the object to Google drive. But I cannot figure out how to get the Google sheet into the data table. The critical part is that I end up with a Google sheet on Google Drive. All attempts failed; seeking guidance.

Cheers,
Mark

1 Like

Hi Mark,

Have you had a look at our documentation on accessing Google Sheets? What have you already tired to do and what isn’t working?

Germane doc code would be this:

new_image = folder.create_file("new_file.jpg",
                               file_loader_1.file)

I would like to create a new Google sheet. Cannot figure out to make the second parameter of create_file be a Google sheet. Have tried getting and setting bytes, converting a Google sheet to media, uploading a file from my machine (I cannot figure out how to save a Google sheet outside of Google; always converted to an xlsx), storing a Google sheet as a Google sheet in a data table, setting the 2nd parm explicitly as a Google sheet MIME type [application/vnd.google-apps.spreadsheet] …

Apologies, one more nuance to mention from the OP.
The full use case is to make a copy of the existing Google Sheet template, to which I will then write data without modifying the existing template.