Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

85
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda