Thursday, July 24, 2025

🟢39Create folder with file in in google drive specified in google sheet Added39

Create a Folder and File in Google Drive from Google Sheets

This Google Apps Script creates a folder and a file in Google Drive based on names you specify in a Google Sheet. It then saves the URLs of the folder and file back to the sheet. Follow these steps to use it:

  1. Open your Google Sheet.
  2. In Sheet2, enter the desired folder name in cell B2 (e.g., "MyFolder") and the file name in cell B3 (e.g., "MyFile.txt").
  3. Click on Extensions > Apps Script in the top menu.
  4. In the Apps Script editor, paste the code below.
  5. Update Sheet2 in the code to match your sheet's name if it's different.
  6. Save the script with a name (e.g., "CreateFolderFile").
  7. Run the script by clicking the play button in the Apps Script editor. Grant permissions when prompted (you may need to authorize access to Google Drive).
  8. Check your sheet: The folder URL will appear in C2, the file URL in C3, and a pop-up will confirm success.

Note: Ensure you have a sheet named "Sheet2" (or update the code to match your sheet name).

No comments:

Post a Comment