Card Service

  • The Card Service enables building card-based user interfaces for Google Workspace add-ons and Google Chat apps across desktop and mobile platforms.

  • Numerous classes are provided for interactive elements, layout, input and display widgets, response handling, data sources, and styling.

  • The service includes builders to construct complex UI components and enumerations for various property options.

  • Methods are available to configure properties, behaviors, and responses for UI elements.

  • Specific classes and methods are detailed for creating and managing different parts of the user interface, such as sections, cards, carousels, and responses.

Card Service

This service allows scripts to configure and build card and widget components and behaviors for a UI. The UI structures you build with this service are automatically available in both desktop and mobile devices, so you don't need to develop separate UIs for both.

Classes

NameBrief description
Action An action that enables interactivity within UI elements.
ActionResponse The response object that may be returned from a callback function (e.g., a form response handler) to perform one or more actions on the client.
ActionResponseBuilder A builder for ActionResponse objects.
ActionStatus A class that represents the status for a request to either invoke or submit a dialog.
Attachment Represents an attachment created by an add-on.
AuthorizationAction An authorization action that will send the user to the AuthorizationUrl when clicked.
AuthorizationException An error that can be returned to trigger an authorization card to be shown to the user.
BorderStyle A class that represents a complete border style that can be applied to widgets.
BorderType An enum that represents the border types that can be applied to widgets.
Button A base class for all buttons.
ButtonSet Holds a set of Button objects that are displayed in a row.
CalendarEventActionResponse Represents a response that makes changes to the calendar event that the user is currently editing in reaction to an action taken in the UI, such as a button click.
CalendarEventActionResponseBuilder A builder for CalendarEventActionResponse objects.
Card A context card that represents a single view in the UI.
CardAction A clickable menu item that is added to the card header menu.
CardBuilder A builder for Card objects.
CardHeader The header of a Card .
CardSection A card section holds groups of widgets and provides visual separation between them.
CardService CardService provides the ability to create generic cards used across different Google extensibility products, such as Google Workspace add-ons.
CardWithId A builder for CardWithId objects.
Carousel Carousel, also known as slider, rotates and displays a list of widgets in a slideshow format, with buttons navigating to the previous or next widget.
CarouselCard A card that can be displayed as a carousel item.
ChatActionResponse A class that represents the parameters that a Chat app can use to configure how its response is posted.
ChatClientDataSource For a SelectionInput widget that uses a multiselect menu, a data source from Google Chat.
ChatResponse The response object for a card message in Google Chat.
ChatResponseBuilder A builder for ChatResponse objects.
ChatSpaceDataSource A data source that populates Google Chat spaces as selection items for a multiselect menu.
Chip A Chip with an icon and text label.
ChipList Holds a set of Chip objects that are displayed in a row, wrapping to the next line to horizontal scrollable.
ChipListLayout An enum that specifies the layout for ChipList .
CollapseControl A customizable collapse and expand control.
Column A column.
Columns The Columns widget displays up to 2 columns in a card or dialog.
CommonDataSource A data source shared by all Google Workspace applications.
CommonWidgetAction Defines actions that don't involve evaluations, such as updating widget visibility.
ComposeActionResponse The response object that may be returned from a callback method for compose action in a Gmail add-on.
ComposeActionResponseBuilder A builder for ComposeActionResponse objects.
ComposedEmailType An enum value that specifies whether the composed email is a standalone or reply draft.
Condition A condition used to run an event action as part of CEL expression validation.
ContentType An enum value that specifies the content type of the content generated by a UpdateDraftActionResponse .
DataSourceConfig A configuration object that helps configure the data sources for a widget.
DatePicker An input field that allows inputing a date.
DateTimePicker An input field that allows users to input a date and time.
DecoratedText A widget that displays text with optional decorations.
Dialog For details, see Open interactive dialogs in the Google Chat documentation.
DialogAction A builder for DialogAction objects.
DisplayStyle An enum that defines the display style of card.
Divider A horizontal divider.
DriveDataSourceSpec Holds a set of DriveItemType objects that are displayed in a row.
DriveItemType An enum define the file type for a drive item.
DriveItemsSelectedActionResponse Represents a response that makes changes to Drive while Drive items are selected and in reaction to an action taken in the UI, such as a button click.
DriveItemsSelectedActionResponseBuilder A builder for DriveItemsSelectedActionResponse objects.
EditorFileScopeActionResponse Makes changes to an Editor, such as Google Docs, Sheets, or Slides in reaction to an action taken in the UI.
EditorFileScopeActionResponseBuilder A builder for EditorFileScopeActionResponse objects.
EventAction An EventAction to run when a CEL expression validation condition is met.
ExpressionData The expression data that is used to evaluate an expression.
ExpressionDataAction Actions for CEL expression validation .
ExpressionDataActionType An enum that represents the type of the expression data action.
ExpressionDataCondition Represents a CEL expression validation result.
ExpressionDataConditionType Represents whether the CEL expression evaluated successfully.
FixedFooter The fixed footer shown at the bottom of a Card .
Grid An organized grid to display a collection of grid items.
GridItem The items users interact with within a grid widget.
GridItemLayout An enum that defines the image and text style of a GridItem.
HorizontalAlignment An enum that specifies the horizontal alignment of a widget.
HorizontalSizeStyle An enum that sets how widgets fill the space of a column.
HostAppDataSource For a SelectionInput widget that uses a multiselect menu, a data source from a Google Workspace application.
Icon Predefined icons that can be used in various UI objects, such as ImageButton or DecoratedText widgets.
IconImage A predefined icon, a material design icon, or an icon from a URL with a customizable crop style.
Image A widget that shows a single image.
ImageButton A ImageButton with an image displayed on it.
ImageButtonStyle An enum that specifies the style for ImageButton .
ImageComponent An image component that can be added to grid items.
ImageCropStyle A class that represents a crop style that can be applied to image components.
ImageCropType An enum that represents the crop styles applied to image components.
ImageStyle An enum that defines an image cropping style.
InputType An enum that defines the input type of the widget.
Interaction An enum type that specifies what to do in response to an interaction with a user, such as a user clicking a button in a card message.
(削除) KeyValue (削除ここまで)This class is deprecated.
LinkPreview Card action that displays a link preview card and smart chip in the host app.
LoadIndicator An enum type that specifies the type of loading or progress indicator to display while an Action is being processed.
MaterialIcon An object that supports all Google Font Icons.
Navigation A helper object that controls card navigation.
Notification A notification shown to the user as a response to interacting with a UI element.
OnClose An enum that specifies what to do when a URL opened through an OpenLink is closed.
OpenAs An enum that specifies how to open a URL.
OpenLink Represents an action to open a link with some options.
OverflowMenu Holds a list of OverflowMenuItem objects that are displayed in a pop-up menu.
OverflowMenuItem An OverflowMenuItem with an icon and text label.
PlatformDataSource For a SelectionInput widget that uses a multiselect menu, a data source from Google Workspace.
ResponseType An enum that represents the type of Chat app response.
SelectionInput An input field that allows choosing between a set of predefined options.
SelectionInputType The format of the items that users can select.
Status An enum that represents the status code.
Suggestions Autocomplete suggestions to supplement a TextInput widget.
SuggestionsResponse A response object that can be returned from a suggestions callback function.
SuggestionsResponseBuilder A builder for SuggestionsResponse objects.
Switch A UI element that supports being toggled on or off.
SwitchControlType Type of a Switch widget control.
TextButton A TextButton with a text label.
TextButtonStyle An enum that specifies the style for TextButton .
TextInput A input field widget that accepts text input.
TextInputMode An enum that defines the what type of input is allowed for the text input field.
TextParagraph A widget that displays text and supports basic HTML formatting.
TimePicker An input field that allows users to input a time.
Trigger A trigger that runs CEL expression validation widget event actions according to the action rule ID.
UniversalActionResponse The response object that may be returned from a method that creates universal action.
UniversalActionResponseBuilder A builder for the UniversalActionResponse objects.
UpdateDraftActionResponse Represents an action that updates the email draft that the user is currently editing.
UpdateDraftActionResponseBuilder A builder for UpdateDraftActionResponse objects.
UpdateDraftBccRecipientsAction Updates the Bcc recipients of an email draft.
UpdateDraftBodyAction Updates the email draft body.
UpdateDraftBodyType An enum value that specifies the type of an UpdateDraftBodyAction .
UpdateDraftCcRecipientsAction Updates the Cc recipients of an email draft.
UpdateDraftSubjectAction Updates the subject line of an email draft.
UpdateDraftToRecipientsAction Updates the To recipients of an email draft.
UpdateVisibilityAction Updates the visibility of a card widget to make it display or to hide it.
UpdatedWidget The response of the updated widget.
Validation An object that defines the validation rule for the widget that it is attached to.
VariableButtonSize An enum that represents the size of the variable picker button.
VerticalAlignment An enum that sets the vertical alignment of widgets in a column.
Visibility An enum that represents the visibility state of the widgets.
Widget Base class for all widgets that can be added to a Card .
WorkflowDataSource For a SelectionInput ,DateTimePicker ` or TextInput widget, a data source used in Google Workspace Studio.
WorkflowDataSourceType An enum that represents the type of the workflow data source.
WrapStyle An enum that sets the wrapping style for content within a column.

Action

Methods

MethodReturn typeBrief description
addRequiredWidget(requiredWidget) Action Adds the names of the widgets that this Action needs for a valid submission.
setAllWidgetsAreRequired(allWidgetsAreRequired) Action Indicates whether this Action requires inputs from all widgets.
setFunctionName(functionName) Action Sets the name of the callback function to be called.
setInteraction(interaction) Action Sets the interaction with a user, only required when opening a dialog.
setLoadIndicator(loadIndicator) Action Sets the loading indicator that displays while the action is in progress.
setParameters(parameters) Action Allows custom parameters to be passed to the callback function.
setPersistValues(persistValues) Action Indicates whether form values are determined by the client's values or the server's values after an action response updates the form's Card .

ActionResponse

Methods

MethodReturn typeBrief description
printJson() StringPrints the JSON representation of this object.

ActionResponseBuilder

Methods

MethodReturn typeBrief description
build() ActionResponse Builds the current action response and validates it.
setNavigation(navigation) ActionResponseBuilder Sets the response to a Navigation action.
setNotification(notification) ActionResponseBuilder Sets the notification to display when the action is activated.
setOpenLink(openLink) ActionResponseBuilder Sets the URL to navigate to when the action is activated.
setStateChanged(stateChanged) ActionResponseBuilder Sets a flag to indicate that this action changed the existing data state.

ActionStatus

Methods

MethodReturn typeBrief description
setStatusCode(statusCode) ActionStatus Represents the status for a request to either open or submit a dialog.
setUserFacingMessage(message) ActionStatus The message to send users about the status of their request.

Attachment

Methods

MethodReturn typeBrief description
setIconUrl(iconUrl) Attachment Sets the icon URL for the attachment.
setMimeType(mimeType) Attachment Sets the MIME type for the attachment.
setResourceUrl(resourceUrl) Attachment Sets the resource URL for the attachment.
setTitle(title) Attachment Sets the title for the attachment.

AuthorizationAction

Methods

MethodReturn typeBrief description
setAuthorizationUrl(authorizationUrl) AuthorizationAction Sets the authorization URL that user is taken to from the authorization prompt.

AuthorizationException

Methods

MethodReturn typeBrief description
printJson() StringPrints the JSON representation of this object.
setAuthorizationUrl(authUrl) AuthorizationException Sets the authorization URL that user is taken to from the authorization prompt.
setCustomUiCallback(callback) AuthorizationException The name of a function to call to generate a custom authorization prompt.
setResourceDisplayName(name) AuthorizationException Sets the name that is displayed to the user when asking for authorization.
throwException() voidTriggers this exception to be thrown.

BorderStyle

Methods

MethodReturn typeBrief description
setCornerRadius(radius) BorderStyle Sets the corner radius of the border, for example 8.
setStrokeColor(color) BorderStyle Sets the color of the border.
setType(type) BorderStyle Sets the type of the border.

BorderType

Properties

PropertyTypeDescription
NO_BORDEREnumNo border style.
STROKEEnumStroke border style.

Button

Methods

MethodReturn typeBrief description
setAuthorizationAction(action) Button Sets an authorization action that opens a URL to the authorization flow when the object is clicked.
setComposeAction(action, composedEmailType) Button Sets an action that composes a draft email when the object is clicked.
setOnClickAction(action) Button Sets an action that executes when the object is clicked.
setOnClickOpenLinkAction(action) Button Sets an action that opens a URL in a tab when the object is clicked.
setOpenLink(openLink) Button Sets a URL to be opened when the object is clicked.
setOverflowMenu(menu) Button Sets a pop-up menu to be opened when the object is clicked.

ButtonSet

Methods

MethodReturn typeBrief description
addButton(button) ButtonSet Adds a button.
addEventAction(eventAction) Widget Adds the event action that can be performed on the widget.
setId(id) Widget Sets the unique ID assigned that's used to identify the widget to be mutated.
setVisibility(visibility) Widget Sets the visibility of the widget.

CalendarEventActionResponse

Methods

MethodReturn typeBrief description
printJson() StringPrints the JSON representation of this object.

CalendarEventActionResponseBuilder

Methods

MethodReturn typeBrief description
addAttachments(attachments) CalendarEventActionResponseBuilder Specifies that the response should add the attachments to the Calendar event when the associated UI action is taken.
addAttendees(emails) CalendarEventActionResponseBuilder Specifies that the response should add the indicated attendees to the Calendar event when the associated UI action is taken.
build() CalendarEventActionResponse Builds the current Calendar event action response and validates it.
setConferenceData(conferenceData) CalendarEventActionResponseBuilder Specifies that the response should set the indicated conference data to the Calendar event when the associated UI action is taken.

Card

Methods

MethodReturn typeBrief description
printJson() StringPrints the JSON representation of this object.

CardAction

Methods

MethodReturn typeBrief description
setAuthorizationAction(action) CardAction Sets an authorization action that opens a URL to the authorization flow when the object is clicked.
setComposeAction(action, composedEmailType) CardAction Sets an action that composes a draft email when the object is clicked.
setOnClickAction(action) CardAction Sets an action that executes when the object is clicked.
setOnClickOpenLinkAction(action) CardAction Sets an action that opens a URL in a tab when the object is clicked.
setOpenLink(openLink) CardAction Sets a URL to be opened when the object is clicked.
setText(text) CardAction Sets the menu text for this action.

CardBuilder

Methods

MethodReturn typeBrief description
addCardAction(cardAction) CardBuilder Adds a CardAction to this Card.
addExpressionData(expressionData) CardBuilder Adds an expression data to this card.
addSection(section) CardBuilder Adds a section to this card.
build() Card Builds the current card and validates it.
setDisplayStyle(displayStyle) CardBuilder Sets the display style for this card.
setFixedFooter(fixedFooter) CardBuilder Sets a fixed footer for this card.
setHeader(cardHeader) CardBuilder Sets the header for this card.
setName(name) CardBuilder Sets the name for this card.
setPeekCardHeader(peekCardHeader) CardBuilder Sets the peek card header.

CardHeader

Methods

MethodReturn typeBrief description
setImageAltText(imageAltText) CardHeader Sets the alternative text for the header image.
setImageStyle(imageStyle) CardHeader Sets the cropping of the icon in the card header.
setImageUrl(imageUrl) CardHeader Sets the image to use in the header by providing its URL or data string.
setSubtitle(subtitle) CardHeader Sets the subtitle of the card header.
setTitle(title) CardHeader Sets the title of the card header.

CardSection

Methods

MethodReturn typeBrief description
addWidget(widget) CardSection Adds the given widget to this section.
setCollapseControl(collapseControl) CardSection Sets the customizable expand and collapse buttons of the section.
setCollapsible(collapsible) CardSection Sets whether the section can be collapsed.
setHeader(header) CardSection Sets the header of the section.
setId(id) CardSection Sets the unique ID assigned that's used to identify the section to be mutated.
setNumUncollapsibleWidgets(numUncollapsibleWidgets) CardSection Sets the number of widgets that are still shown when this section is collapsed.

CardService

Properties

PropertyTypeDescription
BorderTypeBorderType The BorderType enumeration.
ChipListLayoutChipListLayout The ChipListLayout enumeration.
CommonDataSourceCommonDataSource The CommonDataSource enumeration.
ComposedEmailTypeComposedEmailType The ComposedEmailType enumeration.
ContentTypeContentType The ContentType enumeration.
DriveItemTypeDriveItemType The DriveItemType enumeration.
ExpressionDataActionTypeExpressionDataActionType The ExpressionDataActionType enumeration.
ExpressionDataConditionTypeExpressionDataConditionType The ExpressionDataConditionType enumeration.
GridItemLayoutGridItemLayout The GridItemLayout enumeration.
HorizontalAlignmentHorizontalAlignment The HorizontalAlignment enumeration.
IconIcon The Icon enumeration.
ImageButtonStyleImageButtonStyle The ImageButtonStyle enumeration.
ImageCropTypeImageCropType The ImageCropType enumeration.
ImageStyleImageStyle The ImageStyle enumeration.
InputTypeInputType The InputType enumeration.
LoadIndicatorLoadIndicator The LoadIndicator enumeration.
OnCloseOnClose The OnClose enumeration.
OpenAsOpenAs The OpenAs enumeration.
SelectionInputTypeSelectionInputType The SelectionInputType enumeration.
TextButtonStyleTextButtonStyle The TextButtonStyle enumeration.
TextInputModeTextInputMode The TextInputMode enumeration.
UpdateDraftBodyTypeUpdateDraftBodyType The UpdateDraftBodyType enumeration.
VariableButtonSizeVariableButtonSize The VariableButtonSize enumeration.
VisibilityVisibility The Visibility enumeration.
WorkflowDataSourceTypeWorkflowDataSourceType The WorkflowDataSourceType enumeration.

Methods

MethodReturn typeBrief description
newAction() Action Creates a new Action .
newActionResponseBuilder() ActionResponseBuilder Creates a new ActionResponseBuilder .
newActionStatus() ActionStatus Creates a new ActionStatus .
newAttachment() Attachment Creates a new Attachment .
newAuthorizationAction() AuthorizationAction Creates a new AuthorizationAction .
newAuthorizationException() AuthorizationException Creates a new AuthorizationException .
newBorderStyle() BorderStyle Creates a new BorderStyle .
newButtonSet() ButtonSet Creates a new ButtonSet .
newCalendarEventActionResponseBuilder() CalendarEventActionResponseBuilder Creates a new CalendarEventActionResponseBuilder .
newCardAction() CardAction Creates a new CardAction .
newCardBuilder() CardBuilder Creates a new Card builder.
newCardHeader() CardHeader Creates a new CardHeader .
newCardSection() CardSection Creates a new CardSection .
newCardWithId() CardWithId Creates a new CardWithId .
newCarousel() Carousel Creates a Carousel .
newCarouselCard() CarouselCard Creates a new CarouselCard .
newChatActionResponse() ChatActionResponse Creates a new ChatActionResponse .
newChatResponseBuilder() ChatResponseBuilder Creates a new ChatResponseBuilder .
newChip() Chip Creates a new Chip .
newChipList() ChipList Creates a new ChipList .
newCollapseControl() CollapseControl Creates a new CollapseControl .
newColumn() Column Creates a new Column .
newColumns() Columns Creates a new set of Columns .
newCommonWidgetAction() CommonWidgetAction Creates a new CommonWidgetAction .
newComposeActionResponseBuilder() ComposeActionResponseBuilder Creates a new ComposeActionResponseBuilder .
newCondition() Condition Creates a new Condition used for client-side validation.
newDataSourceConfig() DataSourceConfig Creates a new, empty DataSourceConfig .
newDatePicker() DatePicker Creates a new DatePicker .
newDateTimePicker() DateTimePicker Creates a new DateTimePicker .
newDecoratedText() DecoratedText Creates a new DecoratedText .
newDialog() Dialog Creates a new Dialog .
newDialogAction() DialogAction Creates a new DialogAction .
newDivider() Divider Creates a new Divider .
newDriveDataSourceSpec() DriveDataSourceSpec Creates a new DriveDataSourceSpec .
newDriveItemsSelectedActionResponseBuilder() DriveItemsSelectedActionResponseBuilder Creates a new DriveItemsSelectedActionResponseBuilder .
newEditorFileScopeActionResponseBuilder() EditorFileScopeActionResponseBuilder Creates a new EditorFileScopeActionResponseBuilder .
newEventAction() EventAction Creates a new EventAction used for client-side validation.
newExpressionData() ExpressionData Creates a new ExpressionData used for client-side validation.
newExpressionDataAction() ExpressionDataAction Creates a new ExpressionDataAction used for client-side validation.
newExpressionDataCondition() ExpressionDataCondition Creates a new ExpressionDataCondition used for client-side validation.
newFixedFooter() FixedFooter Creates a new FixedFooter .
newGrid() Grid Creates a new Grid .
newGridItem() GridItem Creates a new GridItem .
newHostAppDataSource() HostAppDataSource Creates a new HostAppDataSource .
newIconImage() IconImage Creates a new IconImage .
newImage() Image Creates a new Image .
newImageButton() ImageButton Creates a new ImageButton .
newImageComponent() ImageComponent Creates a new ImageComponent .
newImageCropStyle() ImageCropStyle Creates a new ImageCropStyle .
newKeyValue() (削除) KeyValue (削除ここまで)Creates a new (削除) KeyValue (削除ここまで).
newLinkPreview() LinkPreview Creates a new LinkPreview .
newMaterialIcon() MaterialIcon Creates a new MaterialIcon .
newNavigation() Navigation Creates a new Navigation .
newNotification() Notification Creates a new Notification .
newOpenLink() OpenLink Creates a new OpenLink .
newOverflowMenu() OverflowMenu Creates a new OverflowMenu .
newOverflowMenuItem() OverflowMenuItem Creates a new OverflowMenuItem .
newPlatformDataSource() PlatformDataSource Creates a new PlatformDataSource .
newSelectionInput() SelectionInput Creates a new SelectionInput .
newSuggestions() Suggestions Creates a new Suggestions .
newSuggestionsResponseBuilder() SuggestionsResponseBuilder Creates a new SuggestionsResponseBuilder .
newSwitch() Switch Creates a new Switch .
newTextButton() TextButton Creates a new TextButton .
newTextInput() TextInput Creates a new TextInput .
newTextParagraph() TextParagraph Creates a new TextParagraph .
newTimePicker() TimePicker Creates a new TimePicker .
newTrigger() Trigger Creates and returns a new Trigger used for client-side validation.
newUniversalActionResponseBuilder() UniversalActionResponseBuilder Creates a new UniversalActionResponseBuilder .
newUpdateDraftActionResponseBuilder() UpdateDraftActionResponseBuilder Creates a new UpdateDraftActionResponseBuilder .
newUpdateDraftBccRecipientsAction() UpdateDraftBccRecipientsAction Creates a new UpdateDraftBccRecipientsAction ;
newUpdateDraftBodyAction() UpdateDraftBodyAction Creates a new UpdateDraftBodyAction .
newUpdateDraftCcRecipientsAction() UpdateDraftCcRecipientsAction Creates a new UpdateDraftCcRecipientsAction .
newUpdateDraftSubjectAction() UpdateDraftSubjectAction Creates a new UpdateDraftSubjectAction .
newUpdateDraftToRecipientsAction() UpdateDraftToRecipientsAction Creates a new UpdateDraftToRecipientsAction .
newUpdateVisibilityAction() UpdateVisibilityAction Creates a new UpdateVisibilityAction .
newValidation() Validation Creates a new Validation .
newWorkflowDataSource() WorkflowDataSource Creates a new WorkflowDataSource .

CardWithId

Methods

MethodReturn typeBrief description
setCard(card) CardWithId Sets the card of the cardWithId.
setCardId(id) CardWithId Sets the unique card ID of the cardWithId.

Methods

MethodReturn typeBrief description
addCarouselCard(card) Carousel Adds a carousel card.
addEventAction(eventAction) Widget Adds the event action that can be performed on the widget.
setId(id) Widget Sets the unique ID assigned that's used to identify the widget to be mutated.
setVisibility(visibility) Widget Sets the visibility of the widget.

CarouselCard

Methods

MethodReturn typeBrief description
addFooterWidget(widget) CarouselCard Adds the given widget to the footer of this carousel card.
addWidget(widget) CarouselCard Adds the given widget to this carousel card.

ChatActionResponse

Methods

MethodReturn typeBrief description
setDialogAction(dialogAction) ChatActionResponse Sets the dialog action to an event related to a dialog.
setResponseType(responseType) ChatActionResponse The type of Chat app response.
setUpdatedWidget(updatedWidget) ChatActionResponse Sets the updated widget, used to provide autocomplete options for a widget.
setUrl(url) ChatActionResponse The URL for users to authenticate or configure.

ChatClientDataSource

Methods

MethodReturn typeBrief description
setSpaceDataSource(spaceDataSource) ChatClientDataSource A data source that populates Google Chat spaces as selection items for a multiselect menu.

ChatResponse

Methods

MethodReturn typeBrief description
printJson() StringPrints the JSON representation of this object.

ChatResponseBuilder

Methods

MethodReturn typeBrief description
addCardsV2(cardWithId) ChatResponseBuilder Sets the card field of the message.
build() ChatResponse Builds the current action response and validates it.
setActionResponse(actionResponse) ChatResponseBuilder Sets the action response field of the message.
setText(text) ChatResponseBuilder Sets the text of the Chat message.

ChatSpaceDataSource

Methods

MethodReturn typeBrief description
setDefaultToCurrentSpace(defaultToCurrentSpace) ChatSpaceDataSource If set to true, the multi select menu selects the current Google Chat space as an item by default.

Chip

Methods

MethodReturn typeBrief description
setAltText(altText) Chip Sets the alternative text of the chip for accessibility.
setAuthorizationAction(action) Chip Sets an authorization action that opens a URL to the authorization flow when the object is clicked.
setComposeAction(action, composedEmailType) Chip Sets an action that composes a draft email when the object is clicked.
setDisabled(disabled) Chip Sets whether the chip is disabled.
setIcon(icon) Chip Sets the icon to be used as the chip.
setLabel(label) Chip Sets the title of the chip.
setOnClickAction(action) Chip Sets an action that executes when the object is clicked.
setOnClickOpenLinkAction(action) Chip Sets an action that opens a URL in a tab when the object is clicked.
setOpenLink(openLink) Chip Sets a URL to be opened when the object is clicked.

ChipList

Methods

MethodReturn typeBrief description
addChip(chip) ChipList Adds a chip.
addEventAction(eventAction) Widget Adds the event action that can be performed on the widget.
setId(id) Widget Sets the unique ID assigned that's used to identify the widget to be mutated.
setLayout(layout) ChipList Sets the chip list layout.
setVisibility(visibility) Widget Sets the visibility of the widget.

ChipListLayout

Properties

PropertyTypeDescription
WRAPPEDEnumThe chip list wraps to the next line if there isn't enough horizontal space.
HORIZONTAL_SCROLLABLEEnumThe chips scroll horizontally if they don't fit in the available space.

CollapseControl

Methods

MethodReturn typeBrief description
setCollapseButton(button) CollapseControl Sets the Button that is displayed for "show less" button.
setExpandButton(button) CollapseControl Sets the Button that is displayed for "show more" button.
setHorizontalAlign(horizontalAlignment) CollapseControl Sets the HorizontalAlignment of the CollapseControl .

Column

Columns

Methods

MethodReturn typeBrief description
addColumn(column) Columns Adds a Column to the Columns widget.
addEventAction(eventAction) Widget Adds the event action that can be performed on the widget.
setId(id) Widget Sets the unique ID assigned that's used to identify the widget to be mutated.
setVisibility(visibility) Widget Sets the visibility of the widget.
setWrapStyle(wrapStyle) Columns Sets the wrap style of the columns, controls how the column resizes based on screen width.

CommonDataSource

Properties

PropertyTypeDescription
UNKNOWNEnumDefault value.
USEREnumGoogle Workspace users.
DRIVEEnumUse Google Drive as a data source.

CommonWidgetAction

Methods

MethodReturn typeBrief description
setUpdateVisibilityAction(updateVisibilityAction) CommonWidgetAction Sets the update visibility action for widgets.

ComposeActionResponse

Methods

MethodReturn typeBrief description
printJson() StringPrints the JSON representation of this object.

ComposeActionResponseBuilder

Methods

MethodReturn typeBrief description
build() ComposeActionResponse Builds the current compose action response and validates it.
setGmailDraft(draft) ComposeActionResponseBuilder Sets the draft GmailMessage created using GmailMessage.createDraftReply(body) or similar functions.

ComposedEmailType

Properties

PropertyTypeDescription
REPLY_AS_DRAFTEnumA draft that is a reply to another message.
STANDALONE_DRAFTEnumA draft that is a standalone message.

Condition

Methods

MethodReturn typeBrief description
setActionRuleId(actionRuleId) Condition The unique ID of the action rule to run in response to the condition.
setExpressionDataCondition(expressionDataCondition) Condition Sets the CEL expression validation condition used to determine whether the event action should run.

ContentType

Properties

PropertyTypeDescription
TEXTEnumIndicates that the generated content is plain text.
MUTABLE_HTMLEnumIndicates that the generated content is formatted as HTML.
IMMUTABLE_HTMLEnumIndicates that the generated content is formatted as HTML, but this content cannot be edited after it is generated.

DataSourceConfig

Methods

MethodReturn typeBrief description
setMaxCharactersToDisable(maxCharactersToDisable) DataSourceConfig Sets the maximum number of characters the user can enter before this data provider is disabled.
setMaxResults(maxResults) DataSourceConfig Sets the maximum number of results to return.
setMinCharactersToTrigger(minCharactersToTrigger) DataSourceConfig Sets the minimum number of characters the user must enter before this data provider is triggered to return results.
setPlatformDataSource(platformDataSource) DataSourceConfig Sets the data source to a platform data source.
setRemoteDataSource(action) DataSourceConfig Sets the data source to a remote data provider.

DatePicker

Methods

MethodReturn typeBrief description
addEventAction(eventAction) Widget Adds the event action that can be performed on the widget.
setFieldName(fieldName) DatePicker Sets the field name that identifies this picker in the event object that is generated when there is a UI interaction.
setId(id) Widget Sets the unique ID assigned that's used to identify the widget to be mutated.
setOnChangeAction(action) DatePicker Sets an Action that the script performs whenever the picker input changes.
setTitle(title) DatePicker Sets the title displayed above the input field.
setValueInMsSinceEpoch(valueMsEpoch) DatePicker Sets the prefilled value to be set in the input field.
setValueInMsSinceEpoch(valueMsEpoch) DatePicker Sets the prefilled value to be set in the input field.
setVisibility(visibility) Widget Sets the visibility of the widget.

DateTimePicker

Methods

MethodReturn typeBrief description
addEventAction(eventAction) Widget Adds the event action that can be performed on the widget.
setFieldName(fieldName) DateTimePicker Sets the field name that identifies this picker in the event object that is generated when there is a UI interaction.
setHostAppDataSource(hostAppDataSource) DateTimePicker In a Google Workspace Studio agent, lets input variables accept datetime outputs from other steps in the agent.
setId(id) Widget Sets the unique ID assigned that's used to identify the widget to be mutated.
setOnChangeAction(action) DateTimePicker Sets an Action that the script performs whenever the picker input changes.
setTimeZoneOffsetInMins(timeZoneOffsetMins) DateTimePicker Sets the number of minutes that the time zone should be offset from UTC.
setTitle(title) DateTimePicker Sets the title displayed above the input field.
setValueInMsSinceEpoch(valueMsEpoch) DateTimePicker Sets the prefilled value to be set in the input field.
setValueInMsSinceEpoch(valueMsEpoch) DateTimePicker Sets the prefilled value to be set in the input field.
setVisibility(visibility) Widget Sets the visibility of the widget.

DecoratedText

Methods

MethodReturn typeBrief description
addEventAction(eventAction) Widget Adds the event action that can be performed on the widget.
setAuthorizationAction(action) DecoratedText Sets an authorization action that opens a URL to the authorization flow when the object is clicked.
setBottomLabel(text) DecoratedText Sets the label text to be used as the key and is displayed below the text content.
setButton(button) DecoratedText Sets the Button that is displayed to the right of the text.
setComposeAction(action, composedEmailType) DecoratedText Sets an action that composes a draft email when the object is clicked.
setEndIcon(endIcon) DecoratedText Sets the optional IconImage that is displayed to the right of the content.
setId(id) Widget Sets the unique ID assigned that's used to identify the widget to be mutated.
setOnClickAction(action) DecoratedText Sets an action that executes when the object is clicked.
setOnClickOpenLinkAction(action) DecoratedText Sets an action that opens a URL in a tab when the object is clicked.
setOpenLink(openLink) DecoratedText Sets a URL to be opened when the object is clicked.
setStartIcon(startIcon) DecoratedText Sets the optional IconImage to display before the text content.
setSwitchControl(switchToSet) DecoratedText Sets the Switch that is displayed to the right of the content.
setText(text) DecoratedText Sets the text to be used as the value.
setTopLabel(text) DecoratedText Sets the label text to be used as the key and is displayed above the text content.
setVisibility(visibility) Widget Sets the visibility of the widget.
setWrapText(wrapText) DecoratedText Sets whether the value text should be displayed on a single line or multiple lines.

Dialog

Methods

MethodReturn typeBrief description
setBody(card) Dialog Sets the card of the Dialog.

DialogAction

Methods

MethodReturn typeBrief description
setActionStatus(actionStatus) DialogAction Sets the action status of DialogAction.
setDialog(dialog) DialogAction Sets the dialog of the DialogAction.

DisplayStyle

Properties

PropertyTypeDescription
PEEKEnumShow the card header at the bottom of add-on content over existing content.
REPLACEEnumShow the card by replacing existing content.

Divider

Methods

MethodReturn typeBrief description
addEventAction(eventAction) Widget Adds the event action that can be performed on the widget.
setId(id) Widget Sets the unique ID assigned that's used to identify the widget to be mutated.
setVisibility(visibility) Widget Sets the visibility of the widget.

DriveDataSourceSpec

Methods

MethodReturn typeBrief description
addItemType(driveItemType) DriveDataSourceSpec Adds a driveItemType to allowed item types list.

DriveItemType

Properties

PropertyTypeDescription
DRIVE_ITEM_TYPE_UNSPECIFIEDEnumDefault value.
DOCUMENTSEnumRepresents a Google Docs document.
SPREADSHEETSEnumRepresents a Google Sheets document.
PRESENTATIONSEnumRepresents a Google Slides document.
PDFSEnumRepresents a PDF document.
FORMSEnumRepresents a Google Forms document.
FOLDERSEnumRepresents a Google Drive folder.

DriveItemsSelectedActionResponse

Methods

MethodReturn typeBrief description
printJson() StringPrints the JSON representation of this object.

DriveItemsSelectedActionResponseBuilder

Methods

MethodReturn typeBrief description
build() DriveItemsSelectedActionResponse Builds the current Drive action response.
requestFileScope(itemId) DriveItemsSelectedActionResponseBuilder Specifies that the response requests file scope for the contextually-relevant item in Drive.

EditorFileScopeActionResponse

Methods

MethodReturn typeBrief description
printJson() StringPrints the JSON representation of this object.

EditorFileScopeActionResponseBuilder

Methods

MethodReturn typeBrief description
build() EditorFileScopeActionResponse Builds the current Editor action response.
requestFileScopeForActiveDocument() EditorFileScopeActionResponseBuilder Requests the drive.file scope for the current active Editor document.

EventAction

Methods

MethodReturn typeBrief description
addPostEventTrigger(trigger) EventAction Adds a CEL expression validation condition to evaluate after the event action runs.
setActionRuleId(actionRuleId) EventAction Sets a unique identifier for the event action.
setCommonWidgetAction(commonWidgetAction) EventAction Set the common widget action for widgets.
setExpressionDataAction(expressionDataAction) EventAction Sets the CEL expression validation data action for widgets.

ExpressionData

Methods

MethodReturn typeBrief description
addCondition(condition) ExpressionData Adds a condition to the current expression data.
addEventAction(eventAction) ExpressionData Adds an event action to the current expression data.
setExpression(expression) ExpressionData Sets the expression data value.
setId(id) ExpressionData Sets the expression data id.

ExpressionDataAction

Methods

MethodReturn typeBrief description
setActionType(type) ExpressionDataAction Sets the type of the expression data action.

ExpressionDataActionType

Properties

PropertyTypeDescription
ACTION_TYPE_UNSPECIFIEDEnumThe unspecified action type.
START_EXPRESSION_EVALUATIONEnumThe action to start the CEL expression validation.

ExpressionDataCondition

Methods

MethodReturn typeBrief description
setConditionType(type) ExpressionDataCondition Sets condition type for a CEL expression validation to indicate whether the expression evaluated successfully.

ExpressionDataConditionType

Properties

PropertyTypeDescription
CONDITION_TYPE_UNSPECIFIEDEnumThe unspecified condition type.
EXPRESSION_EVALUATION_SUCCESSEnumThe CEL expression evaluated to a successful result.
EXPRESSION_EVALUATION_FAILUREEnumThe CEL expression evaluated to a failure result.

FixedFooter

Methods

MethodReturn typeBrief description
setPrimaryButton(button) FixedFooter Set the primary button in the fixed footer.
setSecondaryButton(button) FixedFooter Set the secondary button in the fixed footer.

Grid

Methods

MethodReturn typeBrief description
addEventAction(eventAction) Widget Adds the event action that can be performed on the widget.
addItem(gridItem) Grid Adds a new grid item to the grid.
setAuthorizationAction(action) Grid Sets an authorization action that opens a URL to the authorization flow when the object is clicked.
setBorderStyle(borderStyle) Grid Sets the border style applied to each grid item.
setComposeAction(action, composedEmailType) Grid Sets an action that composes a draft email when the object is clicked.
setId(id) Widget Sets the unique ID assigned that's used to identify the widget to be mutated.
setNumColumns(numColumns) Grid The number of columns to display in the grid.
setOnClickAction(action) Grid Sets an action that executes when the object is clicked.
setOnClickOpenLinkAction(action) Grid Sets an action that opens a URL in a tab when the object is clicked.
setOpenLink(openLink) Grid Sets a URL to be opened when the object is clicked.
setTitle(title) Grid Sets the title text of the grid.
setVisibility(visibility) Widget Sets the visibility of the widget.

GridItem

Methods

MethodReturn typeBrief description
setIdentifier(id) GridItem Sets the identifier for the grid item.
setImage(image) GridItem Sets the image for this grid item.
setLayout(layout) GridItem Sets the layout of text and image for the grid item.
setSubtitle(subtitle) GridItem Sets the subtitle of the grid item.
setTextAlignment(alignment) GridItem Sets the horizontal alignment of the grid item.
setTitle(title) GridItem Sets the title text of the grid item.

GridItemLayout

Properties

PropertyTypeDescription
TEXT_BELOWEnumThe title and subtitle are shown below the grid item's image.
TEXT_ABOVEEnumThe title and subtitle are shown above the grid item's image.

HorizontalAlignment

Properties

PropertyTypeDescription
STARTEnumAlign the widget to the start of the sentence side.
CENTEREnumAlign the widget to the center.
ENDEnumAlign the widget to the end of the sentence side.

HorizontalSizeStyle

Properties

PropertyTypeDescription
FILL_AVAILABLE_SPACEEnumSizes the Widget to fill the available horizontal space of a Column .
FILL_MINIMUM_SPACEEnumResizes the Widget to fill the least amount of horizontal space in a Column .

HostAppDataSource

Methods

MethodReturn typeBrief description
setChatDataSource(chatClientDataSource) HostAppDataSource Sets the data source from Google Chat.
setWorkflowDataSource(workflowDataSource) HostAppDataSource Sets the data source from Google Workspace Flows.

Icon

Properties

PropertyTypeDescription
NONEEnumNo icon.
AIRPLANEEnumAirplane flight icon
BOOKMARKEnumBookmark icon
BUSEnumBus icon
CAREnumCar icon
CLOCKEnumClock icon
CONFIRMATION_NUMBER_ICONEnumConfirmation number icon
DOLLAREnumDollar icon
DESCRIPTIONEnumDescription icon
EMAILEnumEmail icon
EVENT_PERFORMEREnumEmail icon
EVENT_SEATEnumEvent seat icon
FLIGHT_ARRIVALEnumFlight arrival icon
FLIGHT_DEPARTUREEnumFlight departure icon
HOTELEnumHotel icon
HOTEL_ROOM_TYPEEnumHotel icon
INVITEEnumInvite icon
MAP_PINEnumMap pin icon
MEMBERSHIPEnumMembershipt icon
MULTIPLE_PEOPLEEnumMultiple people icon
OFFEREnumOffer icon
PERSONEnumPerson icon
PHONEEnumPhone icon
RESTAURANT_ICONEnumRestaurant icon
SHOPPING_CARTEnumShopping cart icon
STAREnumStar icon
STOREEnumStore icon
TICKETEnumTicket icon
TRAINEnumTrain icon
VIDEO_CAMERAEnumVideo camera icon
VIDEO_PLAYEnumVideo play icon

IconImage

Methods

MethodReturn typeBrief description
setAltText(altText) IconImage Sets the alternative text of the URL which is used for accessibility.
setIcon(icon) IconImage Sets the predefined icon if the URL is not set.
setIconUrl(url) IconImage Sets the URL of the icon if the icon is not set.
setImageCropType(imageCropType) IconImage Sets the crop style for the image.
setMaterialIcon(icon) IconImage Sets the material design icon.

Image

Methods

MethodReturn typeBrief description
addEventAction(eventAction) Widget Adds the event action that can be performed on the widget.
setAltText(altText) Image Sets the alternative text of the image for accessibility.
setAuthorizationAction(action) Image Sets an authorization action that opens a URL to the authorization flow when the object is clicked.
setComposeAction(action, composedEmailType) Image Sets an action that composes a draft email when the object is clicked.
setId(id) Widget Sets the unique ID assigned that's used to identify the widget to be mutated.
setImageUrl(url) Image Sets the image to use by providing its URL or data string.
setOnClickAction(action) Image Sets an action that executes when the object is clicked.
setOnClickOpenLinkAction(action) Image Sets an action that opens a URL in a tab when the object is clicked.
setOpenLink(openLink) Image Sets a URL to be opened when the object is clicked.
setVisibility(visibility) Widget Sets the visibility of the widget.

ImageButton

Methods

MethodReturn typeBrief description
setAltText(altText) ImageButton Sets the alternative text of the button for accessibility.
setAuthorizationAction(action) ImageButton Sets an authorization action that opens a URL to the authorization flow when the object is clicked.
setComposeAction(action, composedEmailType) ImageButton Sets an action that composes a draft email when the object is clicked.
setIcon(icon) ImageButton Sets a predefined Icon to display on the button.
setIconUrl(url) ImageButton Sets the URL of an image to use as this button's icon.
setImageButtonStyle(imageButtonStyle) ImageButton Sets the button style.
setMaterialIcon(icon) ImageButton Sets the material design icon.
setOnClickAction(action) ImageButton Sets an action that executes when the object is clicked.
setOnClickOpenLinkAction(action) ImageButton Sets an action that opens a URL in a tab when the object is clicked.
setOpenLink(openLink) ImageButton Sets a URL to be opened when the object is clicked.
setOverflowMenu(menu) ImageButton Sets a pop-up menu to be opened when the object is clicked.

ImageButtonStyle

Properties

PropertyTypeDescription
BORDERLESSEnumImage button with no border.
OUTLINEDEnumImage button with clear background.
FILLEDEnumImage button with colored background.
FILLED_TONALEnumImage button with an alternative middle ground between filled and outlined buttons.

ImageComponent

Methods

MethodReturn typeBrief description
setAltText(altText) ImageComponent Sets the alternative text of the image.
setBorderStyle(borderStyle) ImageComponent Sets the border style applied to the image.
setCropStyle(imageCropStyle) ImageComponent Sets the crop style for the image.
setImageUrl(url) ImageComponent Sets the URL of the image.

ImageCropStyle

Methods

MethodReturn typeBrief description
setAspectRatio(ratio) ImageCropStyle Sets the aspect ratio to use if the crop type is RECTANGLE_CUSTOM.
setImageCropType(type) ImageCropStyle Sets the crop type for the image.

ImageCropType

Properties

PropertyTypeDescription
SQUAREEnumSquare shape crop style.
CIRCLEEnumCircle shape crop style.
RECTANGLE_CUSTOMEnumRectangle shape crop style with custom ratio.
RECTANGLE_4_3EnumRectangle shape crop style with 4:3 ratio.

ImageStyle

Properties

PropertyTypeDescription
SQUAREEnumNo cropping.
CIRCLEEnumCrop to a circle shape.

InputType

Properties

PropertyTypeDescription
TEXTEnumAccept regular text.
INTEGEREnumAccept an integer.
FLOATEnumAccept a floating-point number.
EMAILEnumAccept an email address.

Interaction

Properties

PropertyTypeDescription
INTERACTION_UNSPECIFIEDEnumDefault value.
OPEN_DIALOGEnumOpens a dialog, a card-based interface that Chat apps use to interact with users.

(削除) KeyValue (削除ここまで)

Methods

MethodReturn typeBrief description
addEventAction(eventAction) Widget Adds the event action that can be performed on the widget.
setAuthorizationAction(action) (削除) KeyValue (削除ここまで)Sets an authorization action that opens a URL to the authorization flow when the object is clicked.
setComposeAction(action, composedEmailType) (削除) KeyValue (削除ここまで)Sets an action that composes a draft email when the object is clicked.
setId(id) Widget Sets the unique ID assigned that's used to identify the widget to be mutated.
setOnClickAction(action) (削除) KeyValue (削除ここまで)Sets an action that executes when the object is clicked.
setOnClickOpenLinkAction(action) (削除) KeyValue (削除ここまで)Sets an action that opens a URL in a tab when the object is clicked.
setOpenLink(openLink) (削除) KeyValue (削除ここまで)Sets a URL to be opened when the object is clicked.
setVisibility(visibility) Widget Sets the visibility of the widget.

LinkPreview

Methods

MethodReturn typeBrief description
printJson() StringPrints the JSON representation of this object.
setLinkPreviewTitle(title) LinkPreview Sets the title that displays in the link preview above the preview card.
setPreviewCard(previewCard) LinkPreview Sets the card that displays information about a link from a third-party or non-Google service.
setTitle(title) LinkPreview Sets the title that displays in the smart chip for the link preview.

LoadIndicator

Properties

PropertyTypeDescription
SPINNEREnumUse a spinner indicator.
NONEEnumDo not use an indicator.

MaterialIcon

Methods

MethodReturn typeBrief description
setFill(fill) MaterialIcon Whether the icon renders as filled.
setGrade(grade) MaterialIcon Weight and grade affect a symbol’s thickness.
setName(name) MaterialIcon Sets the name of the icon.
setWeight(weight) MaterialIcon The stroke weight of the icon.

Methods

MethodReturn typeBrief description
popCard() Navigation Pops a card from the navigation stack.
popToNamedCard(cardName) Navigation Pops to the specified card by its card name.
popToRoot() Navigation Pops the card stack to the root card.
printJson() StringPrints the JSON representation of this object.
pushCard(card) Navigation Pushes the given card onto the stack.
updateCard(card) Navigation Does an in-place replacement of the current card.

Notification

Methods

MethodReturn typeBrief description
setText(text) Notification Sets the text to show in the notification.

OnClose

Properties

PropertyTypeDescription
NOTHINGEnumDo nothing on close.
RELOADEnumReloads the add-on on when the window closes.

OpenAs

Properties

PropertyTypeDescription
FULL_SIZEEnumOpen in a full window or tab.
OVERLAYEnumOpen as an overlay such as a pop-up.

Methods

MethodReturn typeBrief description
setOnClose(onClose) OpenLink Sets the behavior of the URL action when the URL window or tab is closed.
setOpenAs(openAs) OpenLink Sets the behavior of URL when it is opened.
setUrl(url) OpenLink Sets the URL to be opened.

OverflowMenu

Methods

MethodReturn typeBrief description
addMenuItem(menuItem) OverflowMenu Adds a menu item.

OverflowMenuItem

Methods

MethodReturn typeBrief description
setAuthorizationAction(action) OverflowMenuItem Sets an authorization action that opens a URL to the authorization flow when the object is clicked.
setComposeAction(action, composedEmailType) OverflowMenuItem Sets an action that composes a draft email when the object is clicked.
setDisabled(disabled) OverflowMenuItem Sets whether the menu item is disabled.
setOnClickAction(action) OverflowMenuItem Sets an action that executes when the object is clicked.
setOnClickOpenLinkAction(action) OverflowMenuItem Sets an action that opens a URL in a tab when the object is clicked.
setOpenLink(openLink) OverflowMenuItem Sets a URL to be opened when the object is clicked.
setStartIcon(icon) OverflowMenuItem Sets the menu item's leading icon.
setText(text) OverflowMenuItem Sets the title of the menu item.

PlatformDataSource

Methods

MethodReturn typeBrief description
setCommonDataSource(commonDataSource) PlatformDataSource Sets the data source from Google Workspace.
setDriveDataSourceSpec(driveDataSourceSpec) PlatformDataSource Sets the drive data source spec from Google Workspace.
setHostAppDataSource(hostAppDataSource) PlatformDataSource Used to populate spaces in multiselect menu.

ResponseType

Properties

PropertyTypeDescription
TYPE_UNSPECIFIEDEnumDefault type that's handled as NEW_MESSAGE.
NEW_MESSAGEEnumPost as a new message in the topic.
UPDATE_MESSAGEEnumUpdate the Chat app's message.
UPDATE_USER_MESSAGE_CARDSEnumUpdate the cards on a user's message.
REQUEST_CONFIGEnumPrivately ask the user for additional authentication or configuration.
DIALOGEnumPresents a dialog.
UPDATE_WIDGETEnumWidget text autocomplete options query.

SelectionInput

Methods

MethodReturn typeBrief description
addDataSourceConfig(dataSourceConfig) SelectionInput Sets the data source configs for the selection control.
addEventAction(eventAction) Widget Adds the event action that can be performed on the widget.
addItem(text, value, selected) SelectionInput Adds a new item that can be selected.
addMultiSelectItem(text, value, selected, startIconUri, bottomText) SelectionInput Adds a new item that can be selected, for multi-select menus.
setExternalDataSource(action) SelectionInput Sets external data source, such as a relational data base.
setFieldName(fieldName) SelectionInput Sets the key that identifies this selection input in the event object that is generated when there is a UI interaction.
setId(id) Widget Sets the unique ID assigned that's used to identify the widget to be mutated.
setMultiSelectMaxSelectedItems(maxSelectedItems) SelectionInput Sets the maximum number of items that a user can select.
setMultiSelectMinQueryLength(queryLength) SelectionInput Sets the number of text characters that a user inputs before the app queries autocomplete and displays suggested items on the card.
setOnChangeAction(action) SelectionInput Sets an Action to be performed whenever the selection input changes.
setPlatformDataSource(platformDataSource) SelectionInput Sets a data source from Google Workspace.
setTitle(title) SelectionInput Sets the title to be shown ahead of the input field.
setType(type) SelectionInput Sets the type of this input.
setVisibility(visibility) Widget Sets the visibility of the widget.

SelectionInputType

Properties

PropertyTypeDescription
CHECK_BOXEnumCheckbox input style.
RADIO_BUTTONEnumRadio button input style.
DROPDOWNEnumDropdown menu selection input style.
SWITCHEnumA set of switches.
MULTI_SELECTEnumA multiselect menu for static or dynamic data.
OVERFLOW_MENUEnumA UI element that houses additional options that don't fit within the primary interface

Status

Properties

PropertyTypeDescription
OKEnumHTTP Mapping: 200 OK
CANCELLEDEnumHTTP Mapping: 499 Client Closed Request
UNKNOWNEnumUnknown error.
INVALID_ARGUMENTEnumThe client specified an invalid argument.
DEADLINE_EXCEEDEDEnumHTTP Mapping: 504 Gateway Timeout
NOT_FOUNDEnumHTTP Mapping: 404 Not Found
ALREADY_EXISTSEnumThe entity that a client attempted to create already exists.
PERMISSION_DENIEDEnumHTTP Mapping: 403 Forbidden
UNAUTHENTICATEDEnumHTTP Mapping: 401 Unauthorized
RESOURCE_EXHAUSTEDEnumHTTP Mapping: 429 Too Many Requests
FAILED_PRECONDITIONEnumThe operation was rejected because the system is not in a state required for the operation's execution.
ABORTEDEnumThe operation was aborted, typically due to a concurrency issue such as a sequencer check failure or transaction abort.
OUT_OF_RANGEEnumThe operation was attempted past the valid range.
UNIMPLEMENTEDEnumHTTP Mapping: 501 Not Implemented
INTERNALEnumInternal errors.
UNAVAILABLEEnumHTTP Mapping: 503 Service Unavailable
DATA_LOSSEnumUnrecoverable data loss or corruption.

Suggestions

Methods

MethodReturn typeBrief description
addSuggestion(suggestion) Suggestions Add a text suggestion.
addSuggestions(suggestions) Suggestions Add a list of text suggestions.

SuggestionsResponse

Methods

MethodReturn typeBrief description
printJson() StringPrints the JSON representation of this object.

SuggestionsResponseBuilder

Methods

MethodReturn typeBrief description
build() SuggestionsResponse Builds the current suggestions response and validates it.
setSuggestions(suggestions) SuggestionsResponseBuilder Sets the suggestions used in auto complete in text fields.

Switch

Methods

MethodReturn typeBrief description
setControlType(controlType) Switch Sets the control type of the switch.
setFieldName(fieldName) Switch Sets the key that identifies this switch in the event object that is generated when there is a UI interaction.
setOnChangeAction(action) Switch Sets the action to take when the switch is toggled.
setSelected(selected) Switch Sets whether this switch should start as selected or unselected.
setValue(value) Switch Sets the value that is sent as the form input when this switch is toggled on.

SwitchControlType

Properties

PropertyTypeDescription
SWITCHEnumToggle-styled control for a switch widget.
CHECK_BOXEnumCheckbox-styled control for a switch widget.

TextButton

Methods

MethodReturn typeBrief description
setAltText(altText) TextButton Sets the alternative text of the button for accessibility.
setAuthorizationAction(action) TextButton Sets an authorization action that opens a URL to the authorization flow when the object is clicked.
setBackgroundColor(backgroundColor) TextButton Sets the background color for TextButtonStyle.FILLED button.
setComposeAction(action, composedEmailType) TextButton Sets an action that composes a draft email when the object is clicked.
setDisabled(disabled) TextButton Sets whether the button is disabled.
setIcon(icon) TextButton Sets a predefined Icon to display on the button.
setIconUrl(url) TextButton Sets the URL of an image to use as this button's icon.
setMaterialIcon(icon) TextButton Sets the material design icon.
setOnClickAction(action) TextButton Sets an action that executes when the object is clicked.
setOnClickOpenLinkAction(action) TextButton Sets an action that opens a URL in a tab when the object is clicked.
setOpenLink(openLink) TextButton Sets a URL to be opened when the object is clicked.
setOverflowMenu(menu) TextButton Sets a pop-up menu to be opened when the object is clicked.
setText(text) TextButton Sets the text that displays on the button.
setTextButtonStyle(textButtonStyle) TextButton Sets the button style.

TextButtonStyle

Properties

PropertyTypeDescription
OUTLINEDEnumNormal text button with clear background.
TEXTEnumDO NOT USE.
FILLEDEnumText button with colored background.
FILLED_TONALEnumNormal text button with an alternative middle ground between filled and outlined buttons.
BORDERLESSEnumNormal text button with no border.

TextInput

Methods

MethodReturn typeBrief description
addEventAction(eventAction) Widget Adds the event action that can be performed on the widget.
setFieldName(fieldName) TextInput Sets the key that identifies this text input in the event object that is generated when there is a UI interaction.
setHint(hint) TextInput Sets a hint for the text input.
setHostAppDataSource(hostAppDataSource) TextInput Sets a data source from Google Workspace applications.
setId(id) Widget Sets the unique ID assigned that's used to identify the widget to be mutated.
setInputMode(inputMode) TextInput Sets whether this text input field supports variable insertion.
setMultiline(multiline) TextInput Sets whether the input text shows on one line or multiple lines.
setOnChangeAction(action) TextInput Sets an action to be performed whenever the text input changes.
setSuggestions(suggestions) TextInput Sets the suggestions for autocompletion in the text field.
setSuggestionsAction(suggestionsAction) TextInput Sets the callback action to fetch suggestions based on user input for autocompletion.
setTitle(title) TextInput Sets the title to be shown above the input field.
setValidation(validation) TextInput Sets the validation rule for this widget.
setValue(value) TextInput Sets the pre-filled value to be set in the input field.
setVisibility(visibility) Widget Sets the visibility of the widget.

TextInputMode

Properties

PropertyTypeDescription
PLAIN_TEXTEnumOnly allow plain text input.
RICH_TEXTEnumSupport both plain text input and variables in a text input.

TextParagraph

Methods

MethodReturn typeBrief description
addEventAction(eventAction) Widget Adds the event action that can be performed on the widget.
setId(id) Widget Sets the unique ID assigned that's used to identify the widget to be mutated.
setMaxLines(maxLines) TextParagraph Sets the maximum number of lines of text that are displayed in the widget.
setText(text) TextParagraph Sets the text of the paragraph.
setVisibility(visibility) Widget Sets the visibility of the widget.

TimePicker

Methods

MethodReturn typeBrief description
addEventAction(eventAction) Widget Adds the event action that can be performed on the widget.
setFieldName(fieldName) TimePicker Sets the field name that identifies this picker in the event object that is generated when there is a UI interaction.
setHours(hours) TimePicker Sets the prefilled hours value to set in the input field.
setId(id) Widget Sets the unique ID assigned that's used to identify the widget to be mutated.
setMinutes(minutes) TimePicker Sets the prefilled minutes value to set in the input field.
setOnChangeAction(action) TimePicker Sets an Action that the script performs whenever the picker input changes.
setTitle(title) TimePicker Sets the title displayed above the input field.
setVisibility(visibility) Widget Sets the visibility of the widget.

Trigger

Methods

MethodReturn typeBrief description
setActionRuleId(actionRuleId) Trigger Sets the action rule id for the trigger.

UniversalActionResponse

Methods

MethodReturn typeBrief description
printJson() StringPrints the JSON representation of this object.

UniversalActionResponseBuilder

Methods

MethodReturn typeBrief description
build() UniversalActionResponse Builds the current universal action response and validates it.
displayAddOnCards(cardObjects) UniversalActionResponseBuilder Displays the add-on with the specified cards.
setOpenLink(openLink) UniversalActionResponseBuilder Sets the URL to open when the universal action is selected.

UpdateDraftActionResponse

Methods

MethodReturn typeBrief description
printJson() StringPrints the JSON representation of this object.

UpdateDraftActionResponseBuilder

Methods

MethodReturn typeBrief description
build() UpdateDraftActionResponse Builds the current update draft action response and validates it.
setUpdateDraftBccRecipientsAction(updateDraftBccRecipientsAction) UpdateDraftActionResponseBuilder Sets an action that updates the email Bcc recipients of a draft.
setUpdateDraftBodyAction(updateDraftBodyAction) UpdateDraftActionResponseBuilder Set an action that updates the email body of a draft.
setUpdateDraftCcRecipientsAction(updateDraftCcRecipientsAction) UpdateDraftActionResponseBuilder Sets an action that updates the Cc recipients of a draft.
setUpdateDraftSubjectAction(updateDraftSubjectAction) UpdateDraftActionResponseBuilder Sets an action that updates the subject line of a draft.
setUpdateDraftToRecipientsAction(updateDraftToRecipientsAction) UpdateDraftActionResponseBuilder Sets an action that updates the To recipients of a draft.

UpdateDraftBccRecipientsAction

Methods

MethodReturn typeBrief description
addUpdateBccRecipients(bccRecipientEmails) UpdateDraftBccRecipientsAction Updates the Bcc recipients of an email draft.

UpdateDraftBodyAction

Methods

MethodReturn typeBrief description
addUpdateContent(content, contentType) UpdateDraftBodyAction Adds the specified content to the draft body.
setUpdateType(updateType) UpdateDraftBodyAction Sets the UpdateDraftBodyType of this update action on the draft body.

UpdateDraftBodyType

Properties

PropertyTypeDescription
IN_PLACE_INSERTEnumDefault.
INSERT_AT_STARTEnumUpdate actions insert content at the start of message body.
INSERT_AT_ENDEnumUpdate actions insert content at the end of the message body.

UpdateDraftCcRecipientsAction

Methods

MethodReturn typeBrief description
addUpdateCcRecipients(ccRecipientEmails) UpdateDraftCcRecipientsAction Updates the Cc recipients of an email draft.

UpdateDraftSubjectAction

Methods

MethodReturn typeBrief description
addUpdateSubject(subject) UpdateDraftSubjectAction Updates the subject line of an email draft.

UpdateDraftToRecipientsAction

Methods

MethodReturn typeBrief description
addUpdateToRecipients(toRecipientEmails) UpdateDraftToRecipientsAction Updates the To recipients of an email draft.

UpdateVisibilityAction

Methods

MethodReturn typeBrief description
setVisibility(visibility) UpdateVisibilityAction Sets the visibility of widgets to visible or hidden.

UpdatedWidget

Methods

MethodReturn typeBrief description
addItem(text, value, selected, startIconUri, bottomText) UpdatedWidget Adds a new item that can be selected.

Validation

Methods

MethodReturn typeBrief description
setCharacterLimit(characterLimit) Validation Sets the character limit of the widget.
setInputType(inputType) Validation Sets the input type of the widget.

VariableButtonSize

Properties

PropertyTypeDescription
UNSPECIFIEDEnumAutomatically chooses COMPACT for Sidepanel, chooses FULL_SIZE otherwise.
COMPACTEnumFor buttons labeled `+`
FULL_SIZEEnumFor buttons labeled `+ variable`

VerticalAlignment

Properties

PropertyTypeDescription
CENTEREnumVertically places the content at the center of the container.
TOPEnumVertically places the content at the top of the container.
BOTTOMEnumVertically places the content at the bottom of the container.

Visibility

Properties

PropertyTypeDescription
VISIBLEEnumThe UI element is visible.
HIDDENEnumThe UI element is invisible.
VISIBILITY_UNSPECIFIEDEnumThe UI element is unspecified.

Widget

Methods

MethodReturn typeBrief description
addEventAction(eventAction) Widget Adds the event action that can be performed on the widget.
setId(id) Widget Sets the unique ID assigned that's used to identify the widget to be mutated.
setVisibility(visibility) Widget Sets the visibility of the widget.

WorkflowDataSource

Methods

MethodReturn typeBrief description
setIncludeVariables(includeVariables) WorkflowDataSource Whether to include variables from the previous step in the data source.
setType(type) WorkflowDataSource Sets the type of the workflow data source.
setVariableButtonLabel(variableButtonLabel) WorkflowDataSource Sets the label of the variable picker button, which displays after the `+` sign in FULL_SIZE button size.
setVariableButtonSize(variableButtonSize) WorkflowDataSource Sets the size of the variable picker button, Workflow automatically uses COMPACT in side panel and FULL_SIZE in other cases if UNSPECIFIED is selected.

WorkflowDataSourceType

Properties

PropertyTypeDescription
UNKNOWNEnumDefault value.
USEREnumThe data source is a user's data.
SPACEEnumThe data source is a Google Chat space.
USER_WITH_FREE_FORMEnumThe data source is a user's data; users can choose to view and select existing members from their Google Workspace organization or manually enter an email address or a valid domain.

WrapStyle

Properties

PropertyTypeDescription
NOWRAPEnumNo wrapping.
WRAPEnumWraps the content for any widgets in a column.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026年04月13日 UTC.