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

256
Views
Google App Script: cómo almacenar el número de filas y modificarlo para actualizar el número de filas almacenado

Esto es lo que estoy tratando de lograr con la función propertiesstorage():

  1. Almacene y guarde el recuento de filas en el almacenamiento de propiedades en Google AppScript.
  2. Haga que los recuentos de filas almacenados se actualicen con los nuevos recuentos de filas agregados. Por ejemplo, primer recuento de filas almacenado === 2000 + segundo recuento de filas almacenado === 2000 = número de filas 4000 en total. Y así sucesivamente

Código

 function rowcount() { var token = getAccessToken(); var module = "sHistory"; var rows = 0; var go = true; var i = 1; var data; var page = 0; while (go) { Utilities.sleep(20000); data = getRecordsByPage(i,200,token,module); if (Number(data.info.count) < 200) { go = false; }; if ((i%10) == 0) { go = false; } else if (Number(data.info.page) === true) { go = true; } page = Number(page) + Number(data.info.page); rows = Number(rows) + Number(data.info.count); //Logger.log("Page " + page); //Logger.log("Zoho Recruit Records" + rows); i++; } return rows; } function propertiesstorage() { // saving rowcount in GAS properties var scriptProperties = PropertiesService.getScriptProperties(); scriptProperties.setProperty("sHistoryRows",rowcount()); //reading rowcount from GAS properties var scriptProperties = PropertiesService.getScriptProperties(); var data = scriptProperties.getProperties(); for(var key in data) { Logger.log([key,"sHistory total count "+ rowcount()]); } var scriptProperties = PropertiesService.getUserProperties(); var updatevalue = userProperties.getProperty(rowcount()); updatevalue = rowcount(); scriptProperties.setProperty("sHistory total count",updatevalue) Logger.log([key,"sHistory total count "+ updatevalue]) } }

Esta es la referencia que estoy usando para intentar lograr esto: https://developers.google.com/apps-script/guides/properties

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!