google-drive-team-drive

Folder getParents fails to get Team Drive name in Google Script

*爱你&永不变心* 提交于 2019-12-01 13:28:42
I'm trying to build up the full path to a document in a team drive using a script. The code looks like this: var path = [ ] var folder = id.getParents() while (folder && folder.hasNext()) { var f = folder.next() path.unshift(f.getName()) folder = f.getParents() } This script is bound to a document for testing. But when I get to the root, instead of returning the actual name of the Team Drive, such as "Accounting" or "Marketing" it instead returns "Team Drive". I need to know the actual name of the Team Drive, why am I not getting this info? If I run this in a script bound to a document in My

Folder getParents fails to get Team Drive name in Google Script

吃可爱长大的小学妹 提交于 2019-12-01 11:04:32
问题 I'm trying to build up the full path to a document in a team drive using a script. The code looks like this: var path = [ ] var folder = id.getParents() while (folder && folder.hasNext()) { var f = folder.next() path.unshift(f.getName()) folder = f.getParents() } This script is bound to a document for testing. But when I get to the root, instead of returning the actual name of the Team Drive, such as "Accounting" or "Marketing" it instead returns "Team Drive". I need to know the actual name

Display only Team Drives in Drive Picker Widget

走远了吗. 提交于 2019-12-01 10:52:35
问题 I am creating an application where I need to provide Drive Picker widget so that users can upload some files. Now I want to restrict users so that they can only select files from their "Team Drives" and not from anywhere else. I've tried adding method in onPickerInit event. Here's my function which is getting called in onPickerInit event, function fetchFolder(widget, pickerBuilder) { pickerBuilder.addView(new google.picker.DocsView() .setParent('TeamDriveId') .setIncludeFolders(true)); } This

Example or template on how to do file upload in Google AppMaker

瘦欲@ 提交于 2019-11-29 18:02:30
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. 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! 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

Google Team Drive Move file between team drive folders using Apps Script

Deadly 提交于 2019-11-28 01:59:11
I am creating a workflow in Appmaker for Team Drive where I have 3 folders under team drive: TO BE APPROVED APPROVED REJECTED I am sending a document from TO BE APPROVED folder for approval, if user approves it then this document should move to APPROVED folder. Same logic for REJECTED. Now my question is how can I move a document between Team Drive folders. DriveApp.getFolderById(folderId).addFile() is not working as I can not have more than one parent in Team Drive. DriveApp.getFolderById(folderId).createFile() is working but it is creating a whole new file with new ID which is not fulfilling

browse files in google team drive

风格不统一 提交于 2019-11-26 22:25:56
问题 I am trying to write a simple Google Apps Script to list the files in a Google Team Drive and I am not having much success. Here is the code: function start() { Logger.log("Starting application..."); var startingFolders = DriveApp.getFoldersByName("Temp"); if (startingFolders.hasNext()) { // Assuming only one folder with that name accessFiles(startingFolders.next()); } else Logger.log("Folder not found"); } function accessFiles(folder) { Logger.log("Folder: %s", folder.getName()); // Print