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 ( |
| Fields | |
|---|---|
| The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: | |
action |
If specified, an action is triggered by this |
openLink |
If specified, this |
openDynamicLinkAction |
An add-on triggers this action when the action needs to open a link. This differs from the
|
card |
A new card is pushed to the card stack after clicking if specified.
|
overflowMenu |
If specified, this |
| End of mutually exclusive fields. | |
OpenLink
Represents an onClick event that opens a hyperlink.
Available for Google Chat apps and Google Workspace add-ons.
| JSON representation |
|---|
{ "url": string, "openAs": enum ( |
| Fields | |
|---|---|
url |
The URL to open. HTTP URLs are converted to HTTPS. |
openAs |
How to open a link.
|
onClose |
Whether the client forgets about a link after opening it, or observes it until the window closes.
|
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 |
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 ( |
| Fields | |
|---|---|
items[] |
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 ( |
| Fields | |
|---|---|
startIcon |
The icon displayed in front of the text. |
text |
Required. The text that identifies or describes the item to users. |
onClick |
Required. The action invoked when a menu option is selected. This |
disabled |
Whether the menu option is disabled. Defaults to false. |