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

250
Vistas
I want to display google script single cell value in html text box on button event

I am totally new and try to learn the script...pls someone help to resolve this issue

simply i wanna to get google script cell value and show to this in text box

GS code

function doGet(e) {
  return HtmlService.createHtmlOutputFromFile('WebAppSecure');
  htmlOutput.message = '';
   return htmlOutput.evaluate();
  }

function getValues(){
  var url = "url link";
  var ss = SpreadsheetApp.openByUrl(url);
  var webAppSheet = ss.getSheetByName("Sheet4");
  var getRange=webAppSheet.getRange(2,1).getValues();
  console.log(getRange);//output value :23:43 PM    Info    Sunil
}

html side

function getresult(){
  google.script.run.withSuccessHandler(function(output) {
   var iterm=document.getElementById("dname").value;
 }).getValues(name);
 console.log(name);
}


 <input type="text" id="dsrn" />
 <input type="button" id="button2" value="ID_Search1" onclick="getresult()"/>
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I don't wish to create a doGet() so here's the same thing done with a dialog:

GS:

function launchMyDialog() {
  SpreadsheetApp.getUi().showModelessDialog(HtmlService.createHtmlOutputFromFile('ah1'),'Dialog Title');
}

function getMyValue() {
  const ss = SpreadsheetApp.getActive();
  const sh = ss.getSheetByName('Sheet0');
  return sh.getRange(2,1).getValue();
}

html:

<!DOCTYPE html>
<html>
  <head>
    <base target="_top">
  </head>
  <body>
  <input type="text" id="txt"/>
  <br /><input type="button" value="Get Data" onClick="getValue();" />
  <script>
    function getValue() {
      google.script.run
      .withSuccessHandler((v) => {document.getElementById("txt").value = v;})
      .getMyValue();
    }
    console.log("my code")
  </script>
  </body>
</html>

enter image description here

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