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

176
Views
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 answers
Answer question

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 Report
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!