I´m new to .gs so this should not be difficult.
I have a Google Spreadsheet with values in a column (Lets say column A). I have created a custom menu using .gs where the user will select an option.
Clicking one of the options (new component) a popup appears with a dropdown menu where user should select from the values.
CustomMenu.gs
function onOpen() {
var ui = SpreadsheetApp.getUi();
// Or DocumentApp or FormApp.
ui.createMenu('bq Library Menu')
.addItem('Add new component', 'newComponent')
.addSeparator()
.addSubMenu(ui.createMenu('Modify existing component')
.addItem('Remove component', 'removeComponent'))
.addToUi();
}
function newComponent() {
var html = HtmlService.createHtmlOutputFromFile('NewComponentForm')
.setWidth(400)
.setHeight(300);
SpreadsheetApp.getUi() // Or DocumentApp or SlidesApp or FormApp.
.showModalDialog(html, 'New Component Form');
}
NewComponentForm.html
<!DOCTYPE html>
<html>
<head>
<base target="_top">
</head>
<body>
<h2>Clickable Dropdown</h2>
<p>Select manufacturer from the list</p>
<div class="dropdown">
<button onclick="loadManufacturers()" class="dropbtn">Dropdown</button>
<div id="myDropdown" class="dropdown-content"></div>
</div>
</body>
I want the dropdown menu to show all elements in column A from the spreadsheet. I´ve tried several options but have not obtained the required result.
So, how do I need to proceed to implement the dropdown populating process?