I am using the Semantic UI multiple search selection dropdown within an html dialog in an Apps Script project. It works perfectly but I can only get the values to return in alphabetical order.
I have found two ways to get the values:
- Using
<form>tag - Using the .dropdown("get value") method as shown in the documentation
Both output alphabetically, not in the order that the user selected them.
[This picture shows an example of a user selection.]

It outputs as Chinese, Hmong, and Spanish but I need it to come out as Hmong, Spanish, and Chinese.
<html><link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css" rel="stylesheet" />
<head><base target="_top"></head><body>
<form>
Translate to:
<select class="ui fluid search dropdown" multiple="" id='languages' name='languages'>
<option value='Chinese (Simplified)'>Chinese (Simplified)</option>"
<option value='Hmong'>Hmong</option>"
<option value='Spanish'>Spanish</option>"
<option value='Arabic'>Arabic</option>"
</select></form>
<button onclick='usingFormTags()'>Save Preferences</button>
<button onclick='passingAsVariable()'>Save Preferences</button>
<script>
function usingFormTags() {
google.script.run.getForm(document.forms[0]);
}
function passingAsVariable() {
var data1 = $("#languages").dropdown("get value");
google.script.run.getData(data1);
}
</script></body></html>
This is using the .dropdown("get value")
function doGet(){
return HtmlService.createHtmlOutput("html");}
function getData(data1){
Logger.log(data1)}
This is using the <form> tag
function doGet(){
return HtmlService.createHtmlOutput("html"); }
function getForm(form) { var languages = form.languages Logger.log(languages)}
I've also tried the .dropdown("get text") in place of "get values" but it returns nothing. Everything I can find online discusses how to get an array of values but nothing about how to get them in the user-defined order.