var userInterface = SpreadsheetApp.getUi(); var getResponse = userInterface.prompt('This is the title', 'This is the question', userInterface.ButtonSet.YES_NO); if(getResponse.getSelectedButton() == userInterface.Button.YES) { Browser.msgBox("You said yes"); Browser.msgBox('You just keyed in:' + getResponse.getResponseText()); }else { Browser.msgBox("You said no"); }