Google Picker - User in a domain can only see shared files and nothing from their Drive

175 views
Skip to first unread message

Alan Wells

unread,
Jul 30, 2019, 10:43:36 AM7/30/19
to Google Apps Script Community
Is there an admin setting in G Suite or domain that would affect what files the Google picker can display?  I have someone reporting that they can only see files shared with them, and not anything from their Drive.  And it looks like they are in a paid account.

Alan Wells

unread,
Aug 1, 2019, 8:15:11 PM8/1/19
to Google Apps Script Community
My user did some research and it seems that Google's File Picker does not access Team Drives in GSuite.

Romain Vialard

unread,
Aug 2, 2019, 4:11:16 AM8/2/19
to Google Apps Script Community
You have to enable it.
There's a DocsView.setEnableSharedDrives(boolean) method.

Alan Wells

unread,
Aug 2, 2019, 12:33:09 PM8/2/19
to Google Apps Script Community
DocsView.setEnabledSharedDrives

doesn't exist as a function.  The documentation is wrong.

There is a function name:
   setEnableDrives

Which is undocumented.

When using:
DocsView.setEnabledSharedDrives

For either listing spreadsheets or just folders, I get the error:
view.setEnableSharedDrives is not a function

Here is a similar Stack Overflow question.
https://stackoverflow.com/questions/55938355/picker-says-setenableshareddrives-is-not-a-function

I did enable the feature:
.enableFeature(Feature.SUPPORT_DRIVES)

But I don't have a team drive in my G Suite account.  I'm only one user.  So I don't know whether it has any effect or not.

Romain Vialard

unread,
Aug 2, 2019, 1:11:16 PM8/2/19
to Google Apps Script Community
Thanks, I hope they will update / fix the documentation soon.
I just created and shared a Shared Drive with you. Feel free to use it for your tests (you have full access).

Alan Wells

unread,
Aug 2, 2019, 1:48:49 PM8/2/19
to Google Apps Script Community
Thank you.  I will check it out.

Alan Wells

unread,
Aug 4, 2019, 10:12:55 AM8/4/19
to Google Apps Script Community
There is a way to get the Google file picker to show shared files and folders, AND files in shared drives.  Note that a shared file and a shared folder is not the same as a shared drive.  A shared drive was formerly know as a "team" drive. 

What I did was to enable a picker feature

      .enableFeature(google.picker.Feature.SUPPORT_DRIVES)


The enableFeature method is part of the Picker Builder class:

      var picker = new google.picker.PickerBuilder()
       
.enableFeature(google.picker.Feature.SUPPORT_DRIVES)

Even though the documentation shows information about:

    DocsView.setEnableSharedDrives(boolean)

The above line produces an error, and doesn't seem to be needed for showing shared files, folders and drives.

I still haven't had confirmation from any users, but it seems to be working for me.

On Tuesday, July 30, 2019 at 10:43:36 AM UTC-4, Alan Wells wrote:
Reply all
Reply to author
Forward
0 new messages