Answer the question
In order to leave comments, you need to log in
How to get the folder names (path) that store the file?
Hello,
You need to write down the path to the file in column 9 (which we get by id from column 3) and this is all in the form of a cycle.
While we managed to glue it, from the found scripts, this is:
var ss = SpreadsheetApp.openById('ID').getSheetByName('Accesses');
var lastRow = ss.getLastRow()
for(var i = 2; i<=lastRow;i++){
if(ss.getRange(i, 3).getValue()){
ss.getRange(i, 9).setValue(DriveApp.getFileById(ss.getRange(i, 3).getValue()).getParents().next().getName().join("/"))}}
Answer the question
In order to leave comments, you need to log in
Absolutely useless occupation that requires a lot of resources. Plus, Disk can have folders within folders of their own folders. How do you like this turn?
The solution is available in this topic How do I locate the path of the folder in which th...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question