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

250
Views
SCRIPTS DE APLICACIONES (HOJAS DE GOOGLE) ¿Cómo puedo agregar solo los datos nuevos a las hojas de la API de la unidad en scripts de aplicaciones?

Tengo un bacalao para enumerar todos los enlaces de Google Drive de archivos / carpetas a Google Sheet, es este https://ourtechroom.com/fix/list-all-googledrive-links-files-folder-to-googlesheet/ Hago un poco modificación. Necesito agregar solo los nuevos datos en la hoja. este es mi código:

Intento hacer un bucle for, pero tal vez get.url y get.value no funcionen en el mismo formato

 var folderId = '1f7nxxfOMtUs1Pa-gK45EKAKuqHZvSJ_W'; if (folderId === "") { Browser.msgBox('Folder ID is invalid'); return; } getFolderTree(folderId, true); }; // Get Folder Tree function getFolderTree(folderId, listAll) { try { // Get folder by id var parentFolder = DriveApp.getFolderById(folderId); // Initialise the sheet var file, data, sheet = SpreadsheetApp.getActive().getSheetByName("listlic"); // Get files and folders getChildFolders(parentFolder.getName(), parentFolder, data, sheet, listAll); } catch (e) { Logger.log(e.toString()); } }; // Get the list of files and folders and their metadata in recursive mode function getChildFolders(parentName, parent, data, sheet, listAll) { var childFolders = parent.getFolders(); let num = 0 // List folders inside the folder while (childFolders.hasNext()) { var childFolder = childFolders.next(); var folderId = childFolder.getId(); num+=1 // List files inside the folder var files = childFolder.getFilesByType(MimeType.GOOGLE_SHEETS); while (listAll & files.hasNext()) { var childFile = files.next(); var link = childFile.getUrl().replace("drivesdk", "sharing"); data = [ parentName + "/" + childFolder.getName() + "/" + childFile.getName(), childFile.getName(), "Files", childFile.getDateCreated(), link, childFile.getLastUpdated(), childFile.getDescription(), childFile.getSize()/1024, childFile.getOwner().getEmail(), ]; // Write var lastRow = sheet.getLastRow(); var activesheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); var datel = childFile.getDateCreated(); for (var i=2; i<= num;i++) { var workingcell = sheet.getRange('A' + i + ':I' + i); var row = workingcell.getValues(); if (row !== data){ sheet.appendRow(data); } num-=1 } } // Recursive call of the subfolder getChildFolders(parentName + "/" + childFolder.getName(), childFolder, data, sheet, listAll); } };``` **help pls**
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!