File Picker using Google Apps Script and Javascript without 3rd party

166 views
Skip to first unread message

Tanaike

unread,
Oct 25, 2021, 2:15:58 AM10/25/21
to Google Apps Script Community
This is a sample script for the file picker using Google Apps Script and Javascript without 3rd party.

I had created the same sample script before. But, in the case of that script, jQuery is used. And, only Google Drive of own account could be used. In this sample script, 3rd party of jQuery is not used, and also, not only Google Drive of your own account, but also Google Drive of the service account can be used. By this, I thought that this file picker will be useful for various scenes. I would be grateful if this was useful for your situation.


Alan Wells

unread,
Oct 25, 2021, 11:37:29 AM10/25/21
to Google Apps Script Community
What Drive scope do you use? Full access?

Tanaike

unread,
Oct 25, 2021, 8:24:01 PM10/25/21
to Google Apps Script Community
At this sample script, the scopes of `https://www.googleapis.com/auth/drive.readonly` from the comment line of "// DriveApp.getFiles()" and `https://www.googleapis.com/auth/script.external_request` are used.

Tanaike

unread,
Oct 26, 2021, 1:50:55 AM10/26/21
to Google Apps Script Community

Alan Wells

unread,
Oct 26, 2021, 11:13:01 AM10/26/21
to Google Apps Script Community
Thank you. It provides an alternative to the Google Picker.

Tanaike

unread,
Oct 26, 2021, 8:34:31 PM10/26/21
to Google Apps Script Community
Thank you for replying. When Drive API at Advanced Google services, the script can be worked with only the scope of "https://www.googleapis.com/auth/drive.metadata.readonly". But, in order to use the service account, I directly requested the endpoint using the access token. By this, the scope of "https://www.googleapis.com/auth/script.external_request" was added.
Reply all
Reply to author
Forward
0 new messages