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

118
Visualizações
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 Respostas
Responde à pergunta

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 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