This video is a tutorial on how to automatically populate file names, links, and timestamps from a Google Drive folder into a Google Sheet. We will be using a Google Apps Script to enable this functionality, so prior knowledge of coding is not required. The end result will be a Google Sheet with a list of all the files in the Google Drive folder, along with their corresponding links, and the date/time the file was added to the folder. This will make it easier to keep track of new files added to the folder and to quickly access them.
script##
function myFunction() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
var folder = DriveApp.getFolderById("189raorZoNkOfZRoWThVilUbgkIGOza0Q");
var files = folder.getFiles();
var file;
var data = [];
while (files.hasNext()) {
file = files.next();
data.push([file.getName(), file.getUrl(), file.getDateCreated(), file.getUrl()]);
}
sheet.getRange(1, 1, data.length, data[0].length).setValues(data);
}
![](https://s2.save4k.ru/pic/9XPNq8bndfg/maxresdefault.jpg)