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

155
Visualizações
Not getting response back in webapp

I am new in app script and trying to make simple webapp, but I am not getting any return from apsscript when webpage is loading, it is returning null instead

Here is the code:-

function loadTest()
{
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  const ssname = ss.getSheetByName('Sales');
  const range = ssname.getDataRange().getValues();
  return range
}

Client side Code:-

document.addEventListener('DOMContentLoaded',(event)=>{
         const startTime = new Date()
         google.script.run.withSuccessHandler(function(e){
         console.log(e)
         }).loadTest()
       })
        
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Seems like you're trying to return prohibited elements like date from server side of webApp, which is making request fail and client getting null as a return .

Try following modification, changing this:-

const range = ssname.getDataRange().getValues();

To this :-

const range = ssname.getDataRange().getDisplayValues();

Reference:-

Parameters and Return Values

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