How can i get all the links of files present in specific folder of google drive?

Is there a way to get all the file URLs from the specific folder of google drive?

  1. Create a google sheet
  2. Add a google apps script, something like this
function getFileIdAndNames() {

 var FileFolderID = '1Ty8jdfe6TbT-8KDuqPAHYNVdZVAmkyDK'; // the ID of the folder with files
 var ss = SpreadsheetApp.getActiveSpreadsheet();
 var sheet = ss.getSheetByName('FileIDsandNames'); // or use 'var sheet = ss.getSheets()[0]';
 var urlCol = 1;
 var urlRow = 1;
 var folder = DriveApp.getFolderById(FileFolderID);
 var files = folder.getFiles();


 while (files.hasNext()) {
 var file =;
 sheet.getRange(urlRow, urlCol).setValue(file.getName());
 sheet.getRange(urlRow, urlCol+1).setValue(file.getId());
 urlRow = urlRow+1;
  1. Run the script to populate the sheet.


  1. Call down the sheet contents to the app with web component