Looking for google-apps-script Answers? Try Ask4KnowledgeBase
Looking for google-apps-script Keywords? Try Ask4Keywords

google-apps-script Create a new folder in a Google Drive root


Example

function createNewFolderInGoogleDrive(folderName) {
  return DriveApp.createFolder(folderName);
}

Use function createNewFolderInGoogleDrive to create folder named Test folder in a Google Drive root:

 var newFolder = createNewFolderInGoogleDrive('Test folder');

newFolder has Class Folder type:

// output id of new folder to log
Logger.log(newFolder.getId());