Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

191
Vistas
How to rerun and stop app script based on the execution log info?

I am looking to run below app script with multiple var url such as

https://www.testurl.com/link1=processing

https://www.testurl.com/link2=processing

https://www.testurl.com/link3=processing

How to add multiple url to below code:

function url() {
      var url = 'https://www.testurl.com/link1=processing';
    
      var options = {
        'method': 'get'
      };
      var response = UrlFetchApp.fetch(url, options);
      Logger.log(response);
    }

Each run with single url shows below execution log

3:33:30 AM  Notice  Execution started
3:33:31 AM  Info        {"status":200,"message":"Import 25 of 200 completed."}
3:33:31 AM  Notice  Execution completed

I am looking to rerun script for first url till i get the log message containing "is not triggered" and then run second url and rerun till i get the log message containing "is not triggered" and then run third url and rerun till i get the log message containing "is not triggered" and then stop.

3:33:30 AM  Notice  Execution started
3:33:31 AM  Info        {"status":403,"message":"Import #16 is not triggered. Request skipped."}
3:33:31 AM  Notice  Execution completed
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

There is really no way for me to test this but I think it illustrates how this can be done:

function getUrls() {
  try {
    var urls = [ 'https://www.testurl.com/link1=processing',
                 'https://www.testurl.com/link2=processing',
                 'https://www.testurl.com/link3=processing' ];

    function getUrl(url) {
      var options = { 'method': 'get' };
      var response = UrlFetchApp.fetch(url, options);
      while( response.message.indexOf("is not triggered") < 0 ) {
        Logger.log(response);
        response = UrlFetchApp.fetch(url, options);
      }
    }

    urls.forEach( getUrl );
  }
  catch(err) {
    Logger.log(err);
  }
}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda