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

117
Vistas
Selecting Multiple Values from a Dropdown List in Google Spreadsheet and Printing Alphabatically

I'm following this link Selecting Multiple Values from a Dropdown List in Google Spreadsheet, it works very well. For Example if i have dropdown with three values like "Red, Black, Green" , and i select "Red & Black" it prints Red & Black perfectly fine, now if i select "Black & Red" it prints respectively. The problem now is if i filter this column in spreadsheet these "Red & Black", "Black & Red" are taken as seperate values which does not make sense because both are same. How can it be done where if i select in any manner it should print alphabattically? any leads? thanks.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Here is the possible solution.

You can add this function a the end of multi-select.gs file:

function sort_contents() {
  var range = SpreadsheetApp.getActiveRange();
  var values = range.getValues();
  var sorted_values = values.map(row => [row[0].split(',').sort().join(',')]);
  range.setValues(sorted_values);
}

Add this function into the dialog.html file, after the function function reset() {...}:

function sort_contents() {
  google.script.run.withSuccessHandler(x=>{}).sort_contents()
}

And add one more button in the dialog.html:

<input type="button" value="Sort" onclick="sort_contents()" />

After that you will have the button 'Sort' that will sort the contents of selected cell (and cells, you can select several cells) alphabetically. So you will able to sort 'Red, Black' into 'Black, Red' anytime.

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