0

can anyone share with me the .zip file for Document Approval template because I can't open it since I'm not using GCS but I wanted to go through how they using Drive Picker widget to upload file and so on.

the error that I got

another thing is, where the file will be uploaded to? is it the owner's Drive? is it possible to upload the document to a single folder of a Team Drive instead? Really appreciate it if anyone can share with me some thoughts or any API will do, Thanks!

alep
  • 135
  • 12

2 Answers2

1

The only way to upload files that App Maker provides out of the box is Drive Picker widget and by default it uploads files to current user's Drive root folder. Drive Picker's API allows to change default upload folder, however App Maker doesn't expose the setting at this time. But it has onPickerInit event that provides you with pickerBuilder that you can use to customize your the picker:

// onPickerInit Drive Picker's event handler
var uploadView = new google.picker.DocsUploadView();
uploadView.setParent('ID of the folder to upload to');

pickerBuilder.addView(uploadView);

This trick works both for personal and Team Drive folders.

Note

It seems that setParent works only in combination with MULTISELECT_ENABLED drive picker feature enabled.

Pavel Shkleinik
  • 6,298
  • 2
  • 24
  • 36
-1

Right now, looks appmaker seems to ALWAYS adds an upload tab itself, so if I add another uploadview, I end up with two upload tabs, the first one uploading to the main folder and selected by default :(

My best guess for a workaround is to not add my own upload view, let the picker upload the file to the main folder, and move the file in the onSelect hook to its final destination. If there's a better way, I'd love the hear.

Mr Printer
  • 104
  • 7
  • I found some low level answer for solving this here: https://stackoverflow.com/questions/51545104/appmaker-and-picker-widget-uploading-to-a-specific-folder#51549430 That works well, but of course it would be nicer if Appmaker would expose this directly instead of having to rely on undocumented behaviour. – Mr Printer Aug 01 '18 at 17:59