I am trying to simulate a simple Login before someone opens my Google Form but for some reason my function for opening dialog box is not firing when I see the form as a normal user, and my function looks as below:
function onFormOpen() {
var ui = FormApp.getUi();
var response = ui.prompt('Getting to know you', 'May I know your name?', ui.ButtonSet.YES_NO);
if (response.getSelectedButton() == ui.Button.YES) {
Logger.log('The user\'s name is %s.', response.getResponseText());
} else if (response.getSelectedButton() == ui.Button.NO) {
Logger.log('The user didn\'t want to provide a name.');
} else {
Logger.log('The user clicked the close button in the dialog\'s title bar.');
}
}
Thou the dialog box shows up when I view the Form from my Google Drive account.
How would I achieve this alternatively so I can pre load some kind of dialog box or something that the user needs to enter some password in order to continue with the rest of the form. Anyone has any idea about this?