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

218
Vistas
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 Respuestas
Responde la pregunta

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