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

219
Visualizações
How to Refresh the Google WebApp on every update?

I'm getting the data from Google sheets and displaying it on Google WebApp front end. But The problem is, the Google WebApp front end don't update itself unless the window is refreshed.

Is there a way to refresh itself when it detects a data change in Google sheets or refreshes itself every 15 minutes.

index.html

<script>
function onSuccess(UpdatedData) {
var div = document.getElementById('output');

div.innerHTML = '<div class="badge bg-primary text-wrap fw-normal" style="width: 6rem; ">Last Updated:</div> <span class="font-weight-normal text-muted fs-6">'+ UpdatedData + '</span>';
}

google.script.run.withSuccessHandler(onSuccess).getdata();
</script>

<body>
<div id="output"></div>
</body>
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

If you want a function to execute every X seconds, you can use the setInterval method.

For example, in your script:

<script>
   function onSuccess(UpdatedData) {
     var div = document.getElementById('output');
   
     div.innerHTML = '<div class="badge bg-primary text-wrap fw-normal" style="width: 6rem; ">Last       Updated:</div> <span class="font-weight-normal text-muted fs-6">'+ UpdatedData + '</span>';
     }
     setInterval(()=>{
       google.script.run.withSuccessHandler(onSuccess).getdata()
     },1e4)
     
</script>
<body>
   <div id="output"></div>
</body>

This will make the function inside the setInerval run every 10 second (10 seconds == 1e4, the time should be in milliseconds). So for refreshing it every 15 minuts you should use 9e5

about 4 years ago · Juan Pablo Isaza Relatório
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