getSelection()
getRecipeList()



function getRecipeList(){
    $.get(getWebAppBackendUrl('/get_list'), function(response) {
        var select = document.getElementById("suggestions");
        var options = JSON.parse(response)["values"];

        for(var i = 0; i < options.length; i++) {
            var opt = options[i];
            var el = document.createElement("option");
            el.textContent = opt;
            el.value = opt;
            select.appendChild(el);
        }
    });
};

function selectRecipe(){
    console.log(document.querySelector('#recipe_selector').value
);
    params = {};
    params["account_id"] = document.querySelector('#recipe_selector').value;
    $.post(getWebAppBackendUrl('/set_variable'),  JSON.stringify(params));
};

document.getElementById("saveButton").addEventListener ("click", selectRecipe, false);