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

138
Views
Seleccione Agregar matriz de Hojas de cálculo de Google como opciones

Quiero crear un menú desplegable de búsqueda para seleccionar los clientes disponibles de una columna en un documento de Hojas de cálculo de Google.

Hasta ahora, he intentado completar el campo con opciones utilizando el siguiente código, pero sigo recibiendo este error:

No se pueden leer las propiedades de undefined (leyendo 'addOption')

La matriz devuelve una matriz en este formato:

[[Cliente 1], [Cliente 2]]

¿Tienes alguna idea de cómo solucionar el error?

 <script> $(function() { $('#customer').selectize({ delimiter: ',', persist: false }); }); (function () { google.script.run.withSuccessHandler( function (selectList) { var $select = $(document.getElementById('customer')); var selectize = $select[0].selectize; for( var i=0; i<selectList.length; i++ ) { selectize.addOption({ value: i+1, text: selectList[i] }); selectize.addItem(i+1); }; } ).getSelectList(); }()); </script> <div class="form-group row"> <label for="kunde"class="col-sm-2 col-form-label">Kunde</label> </div> <div class="col-sm-10"> <select id="customer" placeholder="Select a customer..."> </select> </div>

Código.gs

 function getSelectList() { try { var sheet = SpreadsheetApp.openById("file-id").getSheetByName("Kunden"); var values = sheet.getRange(2,1,sheet.getLastRow(),1).getValues(); return values } catch(err) { Logger.log(err); } };
about 4 years ago · Juan Pablo Isaza
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!