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
Name | Brief 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. |
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. |
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. |
ContentType | An enum value that specifies the content type of the content generated by a UpdateDraftActionResponse . |
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. |
DisplayStyle | An enum that defines the display style of card. |
Divider | A horizontal divider. |
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. |
FixedFooter | The fixed footer shown at the bottom of an add-on 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. |
Icon | Predefined icons that can be used in various UI objects, such as ImageButton or DecoratedText widgets. |
IconImage | A predefined 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. |
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. |
| This class is deprecated. |
LoadIndicator | An enum type that specifies the type of loading or progress indicator to display while an Action is being processed. |
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. |
SelectionInput | An input field that allows choosing between a set of predefined options. |
SelectionInputType | Type of selection input. |
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. |
TextParagraph | A widget that displays text and supports basic HTML formatting. |
TimePicker | An input field that allows users to input a time. |
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. |
Widget | Base class for all widgets that can be added to a Card . |
Action
Methods
Method | Return type | Brief description |
---|---|---|
setFunctionName(functionName) | Action | Sets the name of the callback function to be called. |
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. |
ActionResponse
Methods
Method | Return type | Brief description |
---|---|---|
printJson() | String | Prints the JSON representation of this object. |
ActionResponseBuilder
Methods
Method | Return type | Brief 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. |
Attachment
Methods
Method | Return type | Brief 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
Method | Return type | Brief description |
---|---|---|
setAuthorizationUrl(authorizationUrl) | AuthorizationAction | Sets the authorization URL that user is taken to from the authorization prompt. |
AuthorizationException
Methods
Method | Return type | Brief description |
---|---|---|
printJson() | String | Prints 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() | void | Triggers this exception to be thrown. |
BorderStyle
Methods
Method | Return type | Brief 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
Property | Type | Description |
---|---|---|
NO_BORDER | Enum | No border style. |
STROKE | Enum | Stroke border style. |
Button
Methods
Method | Return type | Brief 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. |
ButtonSet
Methods
Method | Return type | Brief description |
---|---|---|
addButton(button) | ButtonSet | Adds a button. |
CalendarEventActionResponse
Methods
Method | Return type | Brief description |
---|---|---|
printJson() | String | Prints the JSON representation of this object. |
CalendarEventActionResponseBuilder
Methods
Method | Return type | Brief 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
Method | Return type | Brief description |
---|---|---|
printJson() | String | Prints the JSON representation of this object. |
CardAction
Methods
Method | Return type | Brief 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
Method | Return type | Brief description |
---|---|---|
addCardAction(cardAction) | CardBuilder | Adds a CardAction 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
Method | Return type | Brief 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
Method | Return type | Brief description |
---|---|---|
addWidget(widget) | CardSection | Adds the given widget to this section. |
setCollapsible(collapsible) | CardSection | Sets whether the section can be collapsed. |
setHeader(header) | CardSection | Sets the header of the section. |
setNumUncollapsibleWidgets(numUncollapsibleWidgets) | CardSection | Sets the number of widgets that are still shown when this section is collapsed. |
CardService
Properties
Property | Type | Description |
---|---|---|
BorderType | BorderType | The BorderType enumeration. |
ComposedEmailType | ComposedEmailType | The ComposedEmailType enumeration. |
ContentType | ContentType | The ContentType enumeration. |
GridItemLayout | GridItemLayout | The GridItemLayout enumeration. |
HorizontalAlignment | HorizontalAlignment | The HorizontalAlignment enumeration. |
Icon | Icon | The Icon enumeration. |
ImageCropType | ImageCropType | The ImageCropType enumeration. |
ImageStyle | ImageStyle | The ImageStyle enumeration. |
LoadIndicator | LoadIndicator | The LoadIndicator enumeration. |
OnClose | OnClose | The OnClose enumeration. |
OpenAs | OpenAs | The OpenAs enumeration. |
SelectionInputType | SelectionInputType | The SelectionInputType enumeration. |
TextButtonStyle | TextButtonStyle | The TextButtonStyle enumeration. |
UpdateDraftBodyType | UpdateDraftBodyType | The UpdateDraftBodyType enumeration. |
Methods
ComposeActionResponse
Methods
Method | Return type | Brief description |
---|---|---|
printJson() | String | Prints the JSON representation of this object. |
ComposeActionResponseBuilder
Methods
Method | Return type | Brief 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
Property | Type | Description |
---|---|---|
REPLY_AS_DRAFT | Enum | A draft that is a reply to another message. |
STANDALONE_DRAFT | Enum | A draft that is a standalone message. |
ContentType
Properties
Property | Type | Description |
---|---|---|
TEXT | Enum | Indicates that the generated content is plain text. |
MUTABLE_HTML | Enum | Indicates that the generated content is formatted as HTML. |
IMMUTABLE_HTML | Enum | Indicates that the generated content is formatted as HTML, but this content cannot be edited after it is generated. |
DatePicker
Methods
Method | Return type | Brief description |
---|---|---|
setFieldName(fieldName) | DatePicker | Sets the field name that identifies this picker in the event object that is generated when there is a UI interaction. |
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. |
DateTimePicker
Methods
Method | Return type | Brief description |
---|---|---|
setFieldName(fieldName) | DateTimePicker | Sets the field name that identifies this picker in the event object that is generated when there is a UI interaction. |
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. |
DecoratedText
Methods
Method | Return type | Brief description |
---|---|---|
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. |
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. |
setWrapText(wrapText) | DecoratedText | Sets whether the value text should be displayed on a single line or multiple lines. |
DisplayStyle
Properties
Property | Type | Description |
---|---|---|
PEEK | Enum | Show the card header at the bottom of add-on content over existing content. |
REPLACE | Enum | Show the card by replacing existing content. |
Divider
DriveItemsSelectedActionResponse
Methods
Method | Return type | Brief description |
---|---|---|
printJson() | String | Prints the JSON representation of this object. |
DriveItemsSelectedActionResponseBuilder
Methods
Method | Return type | Brief 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
Method | Return type | Brief description |
---|---|---|
printJson() | String | Prints the JSON representation of this object. |
EditorFileScopeActionResponseBuilder
Methods
Method | Return type | Brief description |
---|---|---|
build() | EditorFileScopeActionResponse | Builds the current Editor action response. |
requestFileScopeForActiveDocument() | EditorFileScopeActionResponseBuilder | Requests the drive.file scope for the current active Editor document. |
FixedFooter
Methods
Method | Return type | Brief 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
Method | Return type | Brief description |
---|---|---|
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. |
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. |
GridItem
Methods
Method | Return type | Brief 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
Property | Type | Description |
---|---|---|
TEXT_BELOW | Enum | The title and subtitle are shown below the grid item's image. |
TEXT_ABOVE | Enum | The title and subtitle are shown above the grid item's image. |
HorizontalAlignment
Properties
Property | Type | Description |
---|---|---|
START | Enum | Align the widget to the start of the sentence side. |
CENTER | Enum | Align the widget to the center. |
END | Enum | Align the widget to the end of the sentence side. |
Icon
Properties
Property | Type | Description |
---|---|---|
NONE | Enum | No icon. |
AIRPLANE | Enum | ![]() |
BOOKMARK | Enum | ![]() |
BUS | Enum | ![]() |
CAR | Enum | ![]() |
CLOCK | Enum | ![]() |
CONFIRMATION_NUMBER_ICON | Enum | ![]() |
DOLLAR | Enum | ![]() |
DESCRIPTION | Enum | ![]() |
EMAIL | Enum | ![]() |
EVENT_PERFORMER | Enum | ![]() |
EVENT_SEAT | Enum | ![]() |
FLIGHT_ARRIVAL | Enum | ![]() |
FLIGHT_DEPARTURE | Enum | ![]() |
HOTEL | Enum | ![]() |
HOTEL_ROOM_TYPE | Enum | ![]() |
INVITE | Enum | ![]() |
MAP_PIN | Enum | ![]() |
MEMBERSHIP | Enum | ![]() |
MULTIPLE_PEOPLE | Enum | ![]() |
OFFER | Enum | ![]() |
PERSON | Enum | ![]() |
PHONE | Enum | ![]() |
RESTAURANT_ICON | Enum | ![]() |
SHOPPING_CART | Enum | ![]() |
STAR | Enum | ![]() |
STORE | Enum | ![]() |
TICKET | Enum | ![]() |
TRAIN | Enum | ![]() |
VIDEO_CAMERA | Enum | ![]() |
VIDEO_PLAY | Enum | ![]() |
IconImage
Methods
Method | Return type | Brief 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. |
Image
Methods
Method | Return type | Brief description |
---|---|---|
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. |
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. |
ImageButton
Methods
Method | Return type | Brief 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. |
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. |
ImageComponent
Methods
Method | Return type | Brief 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
Method | Return type | Brief 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
Property | Type | Description |
---|---|---|
SQUARE | Enum | Square shape crop style. |
CIRCLE | Enum | Circle shape crop style. |
RECTANGLE_CUSTOM | Enum | Rectangle shape crop style with custom ratio. |
RECTANGLE_4_3 | Enum | Rectangle shape crop style with 4:3 ratio. |
ImageStyle
Properties
Property | Type | Description |
---|---|---|
SQUARE | Enum | No cropping. |
CIRCLE | Enum | Crop to a circle shape. |
KeyValue
Methods
Method | Return type | Brief description |
---|---|---|
setAuthorizationAction(action) |
| Sets an authorization action that opens a URL to the authorization flow when the object is clicked. |
setComposeAction(action, composedEmailType) |
| Sets an action that composes a draft email when the object is clicked. |
setOnClickAction(action) |
| Sets an action that executes when the object is clicked. |
setOnClickOpenLinkAction(action) |
| Sets an action that opens a URL in a tab when the object is clicked. |
setOpenLink(openLink) |
| Sets a URL to be opened when the object is clicked. |
LoadIndicator
Properties
Property | Type | Description |
---|---|---|
SPINNER | Enum | Use a spinner indicator. |
NONE | Enum | Do not use an indicator. |
Navigation
Methods
Method | Return type | Brief 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() | String | Prints 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
Method | Return type | Brief description |
---|---|---|
setText(text) | Notification | Sets the text to show in the notification. |
OnClose
Properties
Property | Type | Description |
---|---|---|
NOTHING | Enum | Do nothing on close. |
RELOAD | Enum | Reloads the add-on on when the window closes. |
OpenAs
Properties
Property | Type | Description |
---|---|---|
FULL_SIZE | Enum | Open in a full window or tab. |
OVERLAY | Enum | Open as an overlay such as a pop-up. |
OpenLink
Methods
Method | Return type | Brief 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. |
SelectionInput
Methods
Method | Return type | Brief description |
---|---|---|
addItem(text, value, selected) | SelectionInput | Adds a new item that can be selected. |
setFieldName(fieldName) | SelectionInput | Sets the key that identifies this selection input in the event object that is generated when there is a UI interaction. |
setOnChangeAction(action) | SelectionInput | Sets an Action to be performed whenever the selection input changes. |
setTitle(title) | SelectionInput | Sets the title to be shown ahead of the input field. |
setType(type) | SelectionInput | Sets the type of this input. |
SelectionInputType
Properties
Property | Type | Description |
---|---|---|
CHECK_BOX | Enum | Checkbox input style. |
RADIO_BUTTON | Enum | Radio buton input style. |
DROPDOWN | Enum | Dropdown menu selection input style. |
Suggestions
Methods
Method | Return type | Brief description |
---|---|---|
addSuggestion(suggestion) | Suggestions | Add a text suggestion. |
addSuggestions(suggestions) | Suggestions | Add a list of text suggestions. |
SuggestionsResponse
Methods
Method | Return type | Brief description |
---|---|---|
printJson() | String | Prints the JSON representation of this object. |
SuggestionsResponseBuilder
Methods
Method | Return type | Brief 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
Method | Return type | Brief 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
Property | Type | Description |
---|---|---|
SWITCH | Enum | Toggle-styled control for a switch widget. |
CHECK_BOX | Enum | Checkbox-styled control for a switch widget. |
TextButton
Methods
Method | Return type | Brief 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. |
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. |
setText(text) | TextButton | Sets the text that displays on the button. |
setTextButtonStyle(textButtonStyle) | TextButton | Sets the button style. |
TextButtonStyle
Properties
Property | Type | Description |
---|---|---|
TEXT | Enum | Normal text button with clear background. |
FILLED | Enum | Text button with colored background. |
TextInput
Methods
Method | Return type | Brief description |
---|---|---|
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. |
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. |
setValue(value) | TextInput | Sets the pre-filled value to be set in the input field. |
TextParagraph
Methods
Method | Return type | Brief description |
---|---|---|
setText(text) | TextParagraph | Sets the text of the paragraph. |
TimePicker
Methods
Method | Return type | Brief description |
---|---|---|
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. |
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. |
UniversalActionResponse
Methods
Method | Return type | Brief description |
---|---|---|
printJson() | String | Prints the JSON representation of this object. |
UniversalActionResponseBuilder
Methods
Method | Return type | Brief 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
Method | Return type | Brief description |
---|---|---|
printJson() | String | Prints the JSON representation of this object. |
UpdateDraftActionResponseBuilder
Methods
Method | Return type | Brief 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
Method | Return type | Brief description |
---|---|---|
addUpdateBccRecipients(bccRecipientEmails) | UpdateDraftBccRecipientsAction | Updates the Bcc recipients of an email draft. |
UpdateDraftBodyAction
Methods
Method | Return type | Brief 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
Property | Type | Description |
---|---|---|
IN_PLACE_INSERT | Enum | Default. |
INSERT_AT_START | Enum | Update actions insert content at the start of message body. |
INSERT_AT_END | Enum | Update actions insert content at the end of the message body. |
UpdateDraftCcRecipientsAction
Methods
Method | Return type | Brief description |
---|---|---|
addUpdateCcRecipients(ccRecipientEmails) | UpdateDraftCcRecipientsAction | Updates the Cc recipients of an email draft. |
UpdateDraftSubjectAction
Methods
Method | Return type | Brief description |
---|---|---|
addUpdateSubject(subject) | UpdateDraftSubjectAction | Updates the subject line of an email draft. |
UpdateDraftToRecipientsAction
Methods
Method | Return type | Brief description |
---|---|---|
addUpdateToRecipients(toRecipientEmails) | UpdateDraftToRecipientsAction | Updates the To recipients of an email draft. |