Answer the question
In order to leave comments, you need to log in
How to auto-rename a google sheets (google sheets) cell when renaming a folder?
Is it currently possible to create a dependency in Google Sheets on folders? Those. if I rename a certain folder, the cell name or path in google sheets also changes. Maybe there are some interesting macros or something like that. At least directions for deepening if you tell me, I will be grateful.
Answer the question
In order to leave comments, you need to log in
hello, yes it is only possible with a script. If you have no experience in programming, share the table I will help [email protected]
You need to enter the Google spreadsheet code editor. First you need to decide how new folders will get into the table. For example, a button or automatically - it doesn't matter. For example, you have a bunch of folders located in the water main directory. You can run through its composition and check with what is in the table.
let sp = SpreadsheetApp.getActiveSpreadsheet() - подключаемся к нашей таблице
let sheet = sp.getSheetByName() - имеем дело в листом котором данные
let cell = sheet.getRange(2,3) - обратились к ячейке по корординатам (способом много)
let id = cell.getValue() - взяли значение например id
let mainFolder = DriveApp.getFolderById() - также можно получить папку по id (id находится в url папки)
let folders = mainFolder .getFolders - так можно получить все папки внутри
while (folders.hasNext()) { так мы бегаем по всем папкам внутри и вытаскиваем имя
let folder = folders.next();
let name = getName();
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question