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

30% OFF - 9th Anniversary discount on Entity Framework Extensions until December 15 with code: ZZZANNIVERSARY9


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

Got any google-apps-script Question?