Class Notification

Notification

A notification shown to the user as a response to interacting with a UI element.

var action = CardService.newAction().setFunctionName("notificationCallback");
CardService.newTextButton().setText('Save').setOnClickAction(action);

// ...

function notificationCallback() {
  return CardService.newActionResponseBuilder()
      .setNotification(CardService.newNotification()
          .setType(CardService.NotificationType.WARNING)
          .setText("Some info to display to user"))
      .build();
}

Methods

MethodReturn typeBrief description
setText(text)NotificationSets the text to show in the notification.
setType(type)NotificationSets the notification type to show.

Detailed documentation

setText(text)

Sets the text to show in the notification. Required.

Parameters

NameTypeDescription
textStringthe notification text.

Return

Notification — this object, for chaining.


setType(type)

Sets the notification type to show. Required.

Parameters

NameTypeDescription
typeNotificationTypethe notification type.

Return

Notification — this object, for chaining.

发送以下问题的反馈:

此网页
Apps Script
Apps Script
需要帮助?请访问我们的支持页面