Google Drive – List all files id inside a folder (no subfolders)

If you want to list in a spreadsheet all files id that are located inside a folder (no subfolders).

function list_all_files_inside_a_folder(){
  var sh = SpreadsheetApp.getActiveSheet();
  var folder = DriveApp.getFolderById('1a1SkFgbMIr_8z1HnZvIpUPcOQ0NWp3HL'); //Change the folder ID here 
  var list = [];
  list.push(['File Name','File ID','Size(MB)']);
  var files = folder.getFiles();
  while (files.hasNext()){
    file =;
    var row = []

Leave a Reply


Your Cart

No products in the cart.
Start shopping

About Us

Royal Technologies is a System Integration house that supports Web Design, Web Hosting, Domain Registration, Search Engine Optimizing, IT Consulting, Remote or Telephone Support and Software Development. In simpler terms it’s an IT Company dealing in various aspects of implementation and maintenance of computerization. We have learnt from experience and have molded ourselves to be complete IT Company.



Copyright © 2008-2024 Royal Technologies. All rights reserved.
Development by Royal Technologies