Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

118
Views
Estoy tratando de almacenar un elemento de la entrada de los usuarios pero no puedo

Estoy tratando de almacenar un elemento de la entrada de los usuarios que se llama wn pero no se almacena y cuando registro. log (wn) sigo obteniendo la matriz (todos los números, desde 348-372)

Usé wn.getEllemntById(input); pero no funciona (estoy seguro de que tiene algo que ver con el alcance o algo así, pero no sé cómo solucionarlo).

Tampoco sé cómo detener el programa y hacer que continúe cuando el usuario selecciona un débil y hace clic en confirmar.

*Estoy usando Java Script en el script de la aplicación de Google

* Obtengo la entrada de los usuarios de una hoja de Excel

 function menu(){ //get the good week number var date = new Date(); var wn = [(Math.floor(WEEKNUMBER(date))+3).toFixed(0)] do { wn.push((wn[wn.length-1]-1).toFixed(0)) } while(wn[wn.length-1] != 348); var line = "<select style='width:60px;height:40px;' id='input'>" for ( var x in wn ) // thats the loop taht is going to show all the weeks for the user line +="<option>" + wn[x] + "</option>" line +="</select>" Logger.log(wn); var ui = SpreadsheetApp.getUi(); var html = HtmlService.createHtmlOutputFromFile('Selector') .setWidth(200) .setHeight(150).setContent("<div>"+line + "</div><br>. <div><button onclick='reset()'>Confirm</button> </div>. <script>function reset(){var wn = document.getElementById('input').value;document.getElementsByTagName('Body')[0].style.cursor = 'wait';google.script.run.withSuccessHandler(function (){google.script.host.close();}).readWP2(wn); Logger.log(wn);}</script>") SpreadsheetApp.getUi() // Or DocumentApp or SlidesApp or FormApp. .showModalDialog(html, 'Please select a week number'); Logger.log(wn); }

Resumen: quiero detener el programa y hacer que continúe cuando el usuario seleccione un débil y haga clic en confirmar. + Cómo almacenar el número de semana que el usuario selecciona en una variable.

Por favor, hágamelo saber si necesita más explicación.

Gracias

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Creo que solo necesitas esta función:

gs:

 function readWP2(wn) { const ss = SpreadsheetApp.getActive(); const sh = ss.getSheetByName('Sheet1'); sh.getRange("A1").setValue(wn); }
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!