OnClick

Represents how to respond when users click an interactive element on a card, such as a button.

Available for Google Chat apps and Google Workspace add-ons.

JSON representation
{

  "action": {
    object (Action)
  },
  "openLink": {
    object (OpenLink)
  },
  "openDynamicLinkAction": {
    object (Action)
  },
  "card": {
    object (Card)
  },
  "overflowMenu": {
    object (OverflowMenu)
  }
}
Fields
The following is a list of mutually exclusive fields. At most one of the fields will be set in a response:
action

object (Action)

If specified, an action is triggered by this onClick.

card

object (Card)

A new card is pushed to the card stack after clicking if specified.

Available for Google Workspace add-ons and unavailable for Google Chat apps.

overflowMenu

object (OverflowMenu)

If specified, this onClick opens an overflow menu.

End of mutually exclusive fields.

OpenAs

When an OnClick action opens a link, then the client can either open it as a full-size window (if that's the frame used by the client), or an overlay (such as a pop-up). The implementation depends on the client platform capabilities, and the value selected might be ignored if the client doesn't support it. FULL_SIZE is supported by all clients.

Available for Google Workspace add-ons and unavailable for Google Chat apps.

Enums
FULL_SIZE The link opens as a full-size window (if that's the frame used by the client).
OVERLAY The link opens as an overlay, such as a pop-up.

OnClose

What the client does when a link opened by an OnClick action is closed.

Implementation depends on client platform capabilities. For example, a web browser might open a link in a pop-up window with an OnClose handler.

If both OnOpen and OnClose handlers are set, and the client platform can't support both values, OnClose takes precedence.

Available for Google Workspace add-ons and unavailable for Google Chat apps.

Enums
NOTHING Default value. The card doesn't reload; nothing happens.
RELOAD

Reloads the card after the child window closes.

If used in conjunction with OpenAs.OVERLAY, the child window acts as a modal dialog and the parent card is blocked until the child window closes.

OverflowMenu

A widget that presents a pop-up menu with one or more actions that users can invoke. For example, showing non-primary actions in a card. You can use this widget when actions don't fit in the available space. To use, specify this widget in the OnClick action of widgets that support it. For example, in a Button.

Available for Google Chat apps and Google Workspace add-ons.

JSON representation
{
  "items": [
    {
      object (OverflowMenuItem)
    }
  ]
}
Fields
items[]

object (OverflowMenuItem)

Required. The list of menu options.

OverflowMenuItem

An option that users can invoke in an overflow menu.

Available for Google Chat apps and Google Workspace add-ons.

JSON representation
{
  "startIcon": {
    object (Icon)
  },
  "text": string,
  "onClick": {
    object (OnClick)
  },
  "disabled": boolean
}
Fields
startIcon

object (Icon)

The icon displayed in front of the text.

text

string

Required. The text that identifies or describes the item to users.

onClick

object (OnClick)

Required. The action invoked when a menu option is selected. This OnClick cannot contain an OverflowMenu, any specified OverflowMenu is dropped and the menu item disabled.

disabled

boolean

Whether the menu option is disabled. Defaults to false.