Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

84
Views
Get files from the folder which were created yesterday

Could you please advice me how to get a list of google spreadsheet URL in sub-folder by date creation - yesterday. Just a few words about what I need. Everyday I get new sub-folders created automatically with one or several files in it and have to collect some information from those files e.g. name of the file, URL, etc. I would like to set everyday trigger to get information from the previous day. I've tried to get information using this code but it doesn't work. Can you help me? And thank you in advance!

function listYesterdayFiles() {
  var folder = DriveApp.getFolderById("Jksajdhasdj123123klj");
  var files =folder.getFolders().next().getFiles();
  var result = [];
  while (files.hasNext()) {
    var file = files.next();
    result.push([file.getDateCreated()]);
 } 
  Logger.log(result);
  var MILLIS_PER_DAY = 1000 * 60 * 60 * 24;
  var now = new Date;
  var date= new Date(now.getTime() - MILLIS_PER_DAY);
  Logger.log(date)
  if (result = date);
  {var finalList = [];
  while (files.hasNext()) {
    var file = files.next();
    result.push([file.getDateCreated()],file.getName())}
  Logger.log(finalList);
  return finalList;// return most recent file ID
};
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!