I'm trying to use google script to create a prompt dialogue for the user with a drop-down list.
Here's where I'm at so far:
function addProject() {
var ui = SpreadsheetApp.getUi(); // Same variations.
var result = ui.prompt(
'Select project from drop-down',
'(use "Project Index" sheet to add a project)',
ui.ButtonSet.OK);
// Process the user's response.
var button = result.getSelectedButton();
var text = result.getResponseText();
if (button == ui.Button.OK) {
// User clicked "OK".
ui.alert('You selected ' + text + '.');
} else if (button == ui.Button.CANCEL) {
// User clicked "Cancel".
ui.alert('I didn\'t get your project.');
}
}
A button in my sheet activates this function. All this does is create a prompt that you can enter a string into. But I need to use data validation to create a drop-down list that references a range elsewhere in my sheet so that the user can enter anything they want.
Can someone help me get a drop-down list in a prompt dialogue?
Thanks!