GAS as an endpoint to create a spreadsheet for the caller

77 views
Skip to first unread message

Ali G

unread,
Sep 16, 2024, 3:14:30 AMSep 16
to Google Apps Script Community
Hi all,

I was wondering if it was possible to make the google apps script that would be able to create a file in the caller's drive. I have tried using the drive api, but it doesn't work, and to me I feel like the setting of running the web app as the user accessing it, and not being able to create a spreadsheet there kinda defeats the purpose

Best, 
Alazar Genene.

Ed Robinson

unread,
Sep 18, 2024, 3:44:15 PMSep 18
to Google Apps Script Community
Alazar, 
Yes this is possible to do! 

Can you give some more information?  You use the term "web app", is a web app a necessary part of your architecture? Have you got the create-file-code working for yourself first?

Ed

Bruce Mcpherson

unread,
Sep 19, 2024, 2:47:15 AMSep 19
to Google Apps Script Community
You can pass an access token from the original requestor as a web app 
parameter and it will run as that user.  Here's a more complex example 
that uses multiple steps for security,
to avoid exposing the access token, but you should get the idea from it. 
https://ramblings.mcpher.com/sharing-content-not-files-with-apps-script/
Reply all
Reply to author
Forward
0 new messages