Not only does this formula successfully list all the files in a folder, but can it also retrieve specific cell data from each file within the same script?
function listFilesInFolder() {
var folder = DocsList.getFolder("1- Summaries");
var contents = folder.getFiles();
var file;
var data;
var sheet = SpreadsheetApp.getActiveSheet();
sheet.clear();
sheet.appendRow(["Name", "Date", "Size", "URL", "Download", "Description", "Type"]);
for (var i = 0; i < contents.length; i++) {
file = contents[i];
if (file.getFileType() == "SPREADSHEET") {
continue;
}
data = [
file.getName(),
file.getDateCreated(),
file.getValue(B10), **(HERE I'M TRYING TO RETRIEVE DATA, BUT IT'S NOT WORKING)**
file.getUrl(),
"https://docs.google.com/a/acme.com/spreadsheet/ccc?key=" + file.getId(),
file.getDescription(),
"audio/mp3"
]
sheet.appendRow(data);