Page Summary
-
ButtonSet holds a set of Button objects displayed in a row.
-
ButtonSet is available for Google Workspace add-ons and Google Chat apps.
-
You can add a button to a ButtonSet using the
addButton()method.
Holds a set of Button
objects that are displayed in a row.
Available for Google Workspace add-ons and Google Chat apps.
const textButton = CardService . newTextButton (); // Finish building the text button... const imageButton = CardService . newImageButton (); // Finish building the image button... const buttonSet = CardService . newButtonSet (). addButton ( textButton ). addButton ( imageButton );
Methods
| Method | Return type | Brief description |
|---|---|---|
Button
|
Adds a button. | |
Widget
|
Adds the event action that can be performed on the widget. | |
Widget
|
Sets the unique ID assigned that's used to identify the widget to be mutated. | |
Widget
|
Sets the visibility of the widget. |
Detailed documentation
add
Button(button)
Adds a button.
Parameters
| Name | Type | Description |
|---|---|---|
button
|
Button
|
The button to add. |
Return
Button
— This object, for chaining.
add
Event
Action(eventAction)
Adds the event action that can be performed on the widget.
Parameters
| Name | Type | Description |
|---|---|---|
event
|
Event
|
The Event
to be added. |
Return
Widget
— The Object, for chaining.
set
Id(id)
Sets the unique ID assigned that's used to identify the widget to be mutated. Widget mutation is only supported in Add-Ons.
Parameters
| Name | Type | Description |
|---|---|---|
id
|
String
|
The id of the widget, with a limit of 64 characters and in format of `[a-zA-Z0-9-]+`. |
Return
Widget
— This object, for chaining.
set
Visibility(visibility)
Sets the visibility of the widget. The default value is `VISIBLE`.
Parameters
| Name | Type | Description |
|---|---|---|
visibility
|
Visibility
|
The Visibility
of the widget. |
Return
Widget
— The Object, for chaining.

