Search code examples
javascriptgoogle-drive-apigoogle-picker

Google Drive Picker: Show only top level folders


Currently I am using google.picker.​ViewId.FOLDERS view in Google drive picker. This however, shows all the folders(including deep level folders) in my drive.

How to achieve a view in which only the top level folders are displayed at first? This would be similar to Dropbox chooser's file view.


Solution

  • In order to see the folders and files at root level, you can use the view: addView(new google.picker.DocsView().setIncludeFolders(true).setOwnedByMe(true))

    You will be able to search for items in deeper levels.