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

291
Visualizações
Google apps script wont run timed function when deployed as a web app

I've started experimenting with the timer installable trigger but I've run into an issue. I would like this function to run every minute on behalf of the user who opened a deployed web app link.

The project has the right authorization scope in the appsscript.json file but the timer execution always fails.

I tried reducing everything out of the program until it was the most basic it could be and it still always failed.

Here is the very simplified code:

function doGet() {
  ScriptApp.newTrigger('execute')
    .timeBased()
    .everyMinutes(1)
    .create();
}

function execute() {
  for (var i = 1; i <= 10; i++) {
    Logger.log(i);
  }
}

enter image description here

It seems like it has something to do with the timer trigger itself because the code I've tested inside of it seems irrelevant.

Any help would be much appreciated.

Edit:

I believe the issue was because it didn't want to allow the 3rd party account to run my code on behalf of them even though I had the auth scopes.

my solution was to send a spreadsheet 'copy' link instead of a web app and prompt them to run the code via image in the spreadsheet once they copied the sheet (which also copies the attached code). It then ran the timer trigger code fine, I suspect because it was happy it was running its own code and not someone else's.

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