Google Apps Script API
    Preparing search index...

    A response to a prompt dialog displayed in the user-interface environment for a Google App. The response contains any text the user entered in the dialog's input field and indicates which button the user clicked to dismiss the dialog.

    // Display a dialog box with a title, message, input field, and "Yes" and "No" buttons. The
    // user can also close the dialog by clicking the close button in its title bar.
    var ui = DocumentApp.getUi();
    var response = ui.prompt('Getting to know you', 'May I know your name?', ui.ButtonSet.YES_NO);
    
    // Process the user's response.
    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.');
    }
    
    interface PromptResponse {
        getResponseText(): string;
        getSelectedButton(): GoogleAppsScript.Base.Button;
    }
    Index

    Methods