I found this thread on creating a folder in Google Drive from a Google Form submission. Can any one help me on creating a folder but in Google Shared Drives instead from Google Form submission.
Thank you
If you want to create a new folder in the Shared Drive by modifying the following script,
function createFolder(form) {
var items = form.response.getItemResponses()
var name = items[0].getResponse();
DriveApp.createFolder(name);
}
How about the following modification? In the current stage, fortunately, the folder ID is used, you can access the Shared Drive with Drive service.
function createFolder(form) {
var folderId = "###"; // Please set the folder ID on the Shared Drive. If you want to create a new folder to the root folder of the Shared Drive, please set the Drive ID here.
var items = form.response.getItemResponses()
var name = items[0].getResponse();
DriveApp.getFolderById(folderId).createFolder(name);
}
folderId
is the folder ID of the specific folder in the Shared Drive or the Drive ID of the Shared Drive. When the Drive ID is used, the folder is created to the root folder of the Shared Drive.