How to get List of Files with Size from Google Drive Folder and Save into Excel Sheet

preview_player
Показать описание
How to get List of Files with Size from Google Drive Folder and Save into Excel Sheet, in this video we are going to learn How to get List of Files with Size from Google Drive Folder and Save into Excel Sheet.
Script:

function listFolderContents() {
var foldername = 'Final Logos'; // provide the name of Folder from which you want to get the list of files
var ListOfFiles = 'ListOfFiles_' + foldername;



var var_file;
var var_name;
var var_link;
var var_size;

}
};

#ExcelSheet #ExcelTricks #GoogleDrive
Рекомендации по теме
Комментарии
Автор

This is brilliant, simple and exactly what I needed. I had never done App Scripting before and I don't know if I'm ready to be a coder yet but this one saved me hours and hours of time on a project. I thank you very much for taking the time to make a great post. BRAVO!

bobmcconnell
Автор

Worked perfectly. Could have been a 2 minute tutorial, though - but thank you!

ernestachenbach
Автор

Thanks so much! A brilliant script and just what I was looking for!

helenekruger
Автор

Thank you for sharing this!!! Really easy to understand. I want to include parent folders though plus their subfolders, what changes in the code should be done? Thank you. Really appreciate it. :)

FJ-gtqw
Автор

dude thats useful tool. thanks for sharing.

gezegeninsani
Автор

Thanks so much for the help! This has been useful for complete files, but now I've come up with an obstacle. Sometimes I search for a specific phrase, so only the files with that content appear, and next I want to get the filenames of that filtered list. Could you please suggest any option for this?

lic.enriquesanchezgonzalez
Автор

Hi, Thank you for sharing such an amazing script, this is going to save a lot of time making links for files on my G Drive, but I'm having a problem with the timer limit from the App Script, I have so many files (around 16.000) that I can't create files within the 6 minutes limit that the App Script has, is there a way to bypass that?

HelderSilva-zihs
Автор

Do you have this version for shared drive?

dutqtuj
Автор

Hi, I really appreciate this but I have zero knowledge in coding. I just followed as instructed: copy paste the code in App Script, provided the folder name save and run but I am always getting "Error An unknown error has occurred, please try again later." How can I trace what I'm missing? Thank you.

cvhaugn
Автор

It's working, chief! However I had to modify slightly the code so it loads the list to the current file (and, of course, in order to clear anteriorly the active sheet every time as it is triggered periodically). Cheers 👍

Code:
function listFolderContents() {
var foldername = 'YourFolderName'; // provide the name of Folder from which you want to get the list of files
var ListOfFiles = 'ListOfFiles_' + foldername;

var folders =
var folder = folders.next();
var contents = folder.getFiles();




var sheet =
sheet.appendRow( ['name', 'link', 'sizeInMB'] );



var var_file;
var var_name;
var var_link;
var var_size;

while(contents.hasNext()) {
var_file = contents.next();
var_name = var_file.getName();
var_link = var_file.getUrl();

sheet.appendRow( [var_name, var_link, var_size] );
}
};

tomekleddo
Автор

Hey I used the code it worked great but how do I update it when I add more items to the drive folder?

marcoa
Автор

is it possible to list only text files and total number of pages in an sheet? folder name, file name, file type, file page number, file size MB)

pertevdural
Автор

This code is great but it is not working if there is any sub folder in the drive. Is there any solution for it?

shibayanbiswas
Автор

Does it work with Shared Folders as well? I get an error: "Exception: Cannot retrieve the next object: iterator has reached the end."

AndreasLenski-nimh
Автор

What is the language used to create the script?

rudroroy
Автор

Thank you so much! First one I found that worked :)

jenniferprice
Автор

is there a way to get the list of files in drive contain more than 1000 data??

ridhofuadin
Автор

question, how to get length videos? what code do we have to use?

demimasa-gbuc
Автор

Hi, it works but not in subfolders....do you know how to make it work for google drive folder with a few subfolders? Thanks!

ofirronen
Автор

Not working if there are folders with same name. How to handle then? And how to look recursively? Any idea?

miquelvillartamartinez