About:
You have
lots of files in the google drive, and you want to share all of them at once.
Then get the file name and shared link in google sheets to use later with excel
You have lots of files in the google drive, and you want to share all of them at once. Then get the file name and shared link in google sheets to use later with excel
Steps:
- Upload all
files to a folder in google drive
- Open the desired Google Drive
folder and get its ID in the URL from the browser location bar: https://drive.google.com/drive/u/0/folders/<id>
- Open a new Google Sheet and
navigate
- Tools >
Script ditor. In the new script, paste the following script:
- Upload all files to a folder in google drive
- Open the desired Google Drive folder and get its ID in the URL from the browser location bar: https://drive.google.com/drive/u/0/folders/<id>
- Open a new Google Sheet and navigate
- Tools > Script ditor. In the new script, paste the following script:
Code:
function
myFunction() {
var ss=SpreadsheetApp.getActiveSpreadsheet();
var s=ss.getActiveSheet();
var c=s.getActiveCell();
var
fldr=DriveApp.getFolderById(“folderID”);
var files=fldr.getFiles();
var names=[],f,str1,str2;
while (files.hasNext()) {
f=files.next();
str1=’=text(“‘ + f.getUrl() +
‘”,”‘ + “” + ‘”)’;
str2=’=text(“‘ + f.getName() +
‘”,”‘ + “” + ‘”)’;
names.push([str1],[str2]);
}
s.getRange(c.getRow(),c.getColumn(),names.length).setFormulas(names);
}
- Replace
folderID with step 2
- Run the script
It will
list in the google sheet file link, and file name
function myFunction() {
var ss=SpreadsheetApp.getActiveSpreadsheet();
var s=ss.getActiveSheet();
var c=s.getActiveCell();
var fldr=DriveApp.getFolderById(“folderID”);
var files=fldr.getFiles();
var names=[],f,str1,str2;
while (files.hasNext()) {
f=files.next();
str1=’=text(“‘ + f.getUrl() + ‘”,”‘ + “” + ‘”)’;
str2=’=text(“‘ + f.getName() + ‘”,”‘ + “” + ‘”)’;
names.push([str1],[str2]);
}
s.getRange(c.getRow(),c.getColumn(),names.length).setFormulas(names);
}
- Replace folderID with step 2
- Run the script
It will list in the google sheet file link, and file name