How Can I add row in google sheet when I Create a New Folder in Google Drive? - google-drive-api

How Can I add row in google sheet when I Create a New Folder in Google Drive?
I have folder in google drive
and I need when I create a new folder inside it create a new last row in google spreadsheet and add hyperlink with new folder name in column E and the local date created in column G and the parent folder name in column M

Related

Automate and add multiple images from google drive into google sheet

I need to automate and add multiple images from google drive into google sheet in respective cells by referring the image file name in adjacent cell
Example:If a google sheet has 10 employee name then the respective employee photo should be inserted into the adjacent cell automatically from google drive(g drive’s image name will have the same name of the employee name)
Note: i am not from coding background so please help me with complete google apps script and step by step procedure to complete the task

Automatically Creating new folder in Google Drive from Appsheet for each raw

i'm new to Appsheet,
i have built a new app from appsheet for a small team,
the app function is to mange customers (contacts app)
in my app-sheet there is a view called (customers),
this customers View linked to google spreadsheet called (customers_DB)
(customers_DB) contain customers data rows
Customers ID
Customers Name
what i want is when someone add a new customer to the (customers_DB) spreadsheet
automatically it create a new folder in google drive in the customers folder
the folder must be named with the customer ID
and display this directory in the customer contact view in app-sheet
so the users can view the files in this directory in app-sheet and can upload&download files from this directory
https://www.googlecloudcommunity.com/gc/AppSheet-Q-A/Creating-new-folder-in-Google-Drive-from-Appsheet/m-p/518827#M201484
i need to make google script that create folders for each new raw

google drive API create spreadsheet with custom tabs

I am creating a spreadsheet using the drive API.
File fileMetadata = new File();
fileMetadata.setName(fileName);
fileMetadata.setParents(Collections.singletonList(folderId));
fileMetadata.setMimeType(MIME_TYPE_SPREADSHEET);
File file = driveService.files().create(fileMetadata)
.setFields("id, parents, name") // properties in the response
.execute();
However this creates a spreadsheet with 1 tab with title "Sheet 1". How can I create a spreadsheet with the drive API with the spreadsheet containing multiple sheets with titles that I would like to provide?

Script to create new sheets that are protected (Google Sheets)

I already have a script for a button that save and create a new sheet of the saved version.
The goal is to modify a cashier sheet and to create a copy with the date and the name of the cashier. The only part missing for this script is that everytime a new version of the sheet is created it would be protected.
For example, on the picture, the first sheet is called Auberge and it's the one that we modify. Now, I would like that all the new sheets that we create when we press on the button Save, like the one called Alex 4 août, be protected automatically. Then, only the manager could modify the final versions of the cashiers sheets. The employees would only be able to modify the sheet called Auberge and then save it.

Get ID of newly created Folder in Google Apps Script

As part of a Google Apps Script project, I'm trying to move the active spreadsheet and several uploaded files to a new folder that is created within a shared directory.
I have been able to create the new folder with:
DriveApp.getFolderById(parentFolder).createFolder(rename);
But to be able to move the files where I need to know the ID of the folder that's just been created.
The rest of the code works ok - if I just put in a string as another folders ID everything gets moved. I'm just stuck on actually finding that new folder ID.
Any ideas?
ta
You can retrieve folder ID using "getId()". For example, your code can be written as follows.
var id = DriveApp.getFolderById(parentFolder).createFolder(rename).getId();
If the folder name is only one on Drive, you can retrieve folder ID from folder name like below.
var id = DriveApp.getFoldersByName(rename).next().getId();