Индекс
-
Action(сообщение) -
Action.ActionParameter(сообщение) -
Action.Interaction(перечисление) -
Action.LoadIndicator(перечисление) -
BorderStyle(сообщение) -
BorderStyle.BorderType(перечисление) -
Button(сообщение) -
Button.Type(перечисление) -
ButtonList(сообщение) -
Card(сообщение) -
Card.CardAction(сообщение) -
Card.CardFixedFooter(сообщение) -
Card.CardHeader(сообщение) -
Card.DisplayStyle(перечисление) -
Card.DividerStyle(перечисление) -
Card.NestedWidget(сообщение) -
Card.Section(сообщение) -
Card.Visibility(перечисление) -
Carousel(сообщение) -
Carousel.CarouselCard(сообщение) -
Chip(сообщение) -
ChipList(сообщение) -
ChipList.Layout(перечисление) -
CollapseControl(сообщение) -
Columns(сообщение) -
Columns.Column(сообщение) -
Columns.Column.HorizontalSizeStyle(перечисление) -
Columns.Column.VerticalAlignment(перечисление) -
Columns.Column.Widgets(сообщение) -
Condition(сообщение) -
Condition.ExpressionDataCondition(сообщение) -
Condition.ExpressionDataCondition.ConditionType(перечисление) -
DataActions(сообщение) -
DataSourceConfig(сообщение) -
DateTimePicker(сообщение) -
DateTimePicker.DateTimePickerType(перечисление) -
DecoratedText(сообщение) -
DecoratedText.SwitchControl(сообщение) -
DecoratedText.SwitchControl.ControlType(перечисление) -
Divider(сообщение) -
EndNavigation(сообщение) -
EndNavigation.Action(перечисление) -
EventAction(сообщение) -
EventAction.CommonWidgetAction(сообщение) -
EventAction.CommonWidgetAction.UpdateVisibilityAction(сообщение) -
ExpressionData(сообщение) -
GetAutocompletionResponse(сообщение) -
Grid(сообщение) -
Grid.GridItem(сообщение) -
Grid.GridItem.GridItemLayout(перечисление) -
Icon(сообщение) -
Image(сообщение) -
ImageComponent(сообщение) -
ImageCropStyle(сообщение) -
ImageCropStyle.ImageCropType(перечисление) -
Link(сообщение) -
LinkPreview(сообщение) -
MaterialIcon(сообщение) -
ModifyCard(сообщение) -
ModifyCard.UpdateWidget(сообщение) -
ModifyCard.UpdateWidget.SelectionInputWidgetSuggestions(сообщение) -
Navigation(сообщение) -
Notification(сообщение) -
OnClick(сообщение) -
OpenLink(сообщение) -
OpenLink.OnClose(перечисление) -
OpenLink.OpenAs(перечисление) -
OverflowMenu(сообщение) -
OverflowMenu.OverflowMenuItem(сообщение) -
RenderActions(сообщение) -
RenderActions.Action(сообщение) -
SelectionInput(сообщение) -
SelectionInput.PlatformDataSource(сообщение) -
SelectionInput.PlatformDataSource.CommonDataSource(перечисление) -
SelectionInput.SelectionItem(сообщение) -
SelectionInput.SelectionType(перечисление) -
SubmitFormResponse(сообщение) -
Suggestions(сообщение) -
Suggestions.SuggestionItem(сообщение) -
TextInput(сообщение) -
TextInput.Type(перечисление) -
TextParagraph(сообщение) -
TextParagraph.TextSyntax(перечисление) -
Trigger(сообщение) -
Validation(сообщение) -
Validation.InputType(перечисление) -
Widget(сообщение) -
Widget.HorizontalAlignment(перечисление) -
Widget.ImageType(перечисление) -
Widget.VerticalAlignment(перечисление)
Действие
Действие, описывающее поведение при отправке формы. Например, вы можете вызвать скрипт Apps Script для обработки формы. При срабатывании действия значения формы отправляются на сервер.
Доступно для приложений Google Chat и дополнений Google Workspace.
| Поля | |
|---|---|
function | Пользовательская функция, вызываемая при щелчке по содержащему элементу или его активации. Пример использования см. в разделе Чтение данных формы . |
parameters[] | Список параметров действия. |
loadIndicator | Указывает индикатор загрузки, который действие отображает при вызове действия. |
persistValues | Указывает, сохраняются ли значения формы после действия. Значение по умолчанию — Если Если |
interaction | Необязательно. Требуется при открытии диалогового окна . Что делать в ответ на взаимодействие с пользователем, например, нажатие пользователем кнопки в сообщении карточки. Если не указано иное, приложение реагирует, выполняя Указав
|
requiredWidgets[] | Необязательно. Заполните этот список названиями виджетов, необходимых этому действию для корректной отправки. Если перечисленные здесь виджеты не имеют значения при вызове этого действия, отправка формы прерывается.
|
allWidgetsAreRequired | Необязательно. Если это так, то все виджеты считаются обязательными для этого действия.
|
ПараметрДействия
Список строковых параметров, которые необходимо передать при вызове метода действия. Например, рассмотрим три кнопки отсрочки: отложить сейчас, отложить на один день и отложить на следующую неделю. Вы можете использовать action method = snooze() , передав тип и время отсрочки в списке строковых параметров.
Более подробную информацию см. в CommonEventObject .
Доступно для приложений Google Chat и дополнений Google Workspace.
| Поля | |
|---|---|
key | Имя параметра сценария действия. |
value | Значение параметра. |
Взаимодействие
Необязательно. Требуется при открытии диалогового окна .
Что делать в ответ на взаимодействие с пользователем, например, нажатие пользователем кнопки в сообщении карточки.
Если не указано иное, приложение реагирует, выполняя action (например, открытие ссылки или запуск функции) как обычно.
Указав interaction , приложение может реагировать особыми интерактивными способами. Например, установив interaction в значение OPEN_DIALOG , приложение может открыть диалог .
Если указано, индикатор загрузки не отображается. Если указано для дополнения, вся карта удаляется, и в клиенте ничего не отображается.
Доступно для приложений Google Chat и недоступно для дополнений Google Workspace.
| Перечисления | |
|---|---|
INTERACTION_UNSPECIFIED | Значение по умолчанию. action выполняется как обычно. |
OPEN_DIALOG | Открывает диалоговое окно — оконный карточный интерфейс, который приложения чата используют для взаимодействия с пользователями. Поддерживается только приложениями чата в ответ на нажатие кнопок в сообщениях карточек. Если указано для дополнения, вся карточка удаляется, и в клиенте ничего не отображается.
|
Индикатор нагрузки
Указывает индикатор загрузки, который действие отображает при вызове действия.
Доступно для приложений Google Chat и дополнений Google Workspace.
| Перечисления | |
|---|---|
SPINNER | Отображает вращающийся индикатор, указывающий на загрузку контента. |
NONE | Ничего не отображается. |
BorderStyle
Параметры стиля границы карточки или виджета, включая тип и цвет границы.
Доступно для приложений Google Chat и дополнений Google Workspace.
| Поля | |
|---|---|
type | Тип границы. |
strokeColor | Цвета, которые следует использовать, если тип — Чтобы задать цвет обводки, укажите значения для полей Например, следующий код устанавливает красный цвет с максимальной интенсивностью: Поле |
cornerRadius | Радиус угла границы. |
BorderType
Представляет типы границ, применяемые к виджетам.
Доступно для приложений Google Chat и дополнений Google Workspace.
| Перечисления | |
|---|---|
BORDER_TYPE_UNSPECIFIED | Не использовать. Не указано. |
NO_BORDER | Границы нет. |
STROKE | Значение по умолчанию. Контур. |
Кнопка
Текст, значок или кнопка с текстом и значком, на которые могут нажимать пользователи. Пример в приложениях Google Chat см. в разделе «Добавить кнопку» .
Чтобы сделать изображение кнопкой, на которую можно нажать, укажите (не Image ) и задайте действие ImageComponentonClick .
Доступно для приложений Google Chat и дополнений Google Workspace.
| Поля | |
|---|---|
text | Текст, отображаемый внутри кнопки. |
icon | Значок, отображаемый внутри кнопки. Если заданы и |
color | Необязательный. Цвет кнопки. Если задано, Чтобы задать цвет кнопки, укажите значения для полей Например, следующий код устанавливает красный цвет с максимальной интенсивностью: Поле |
onClick | Обязательно. Действие, которое необходимо выполнить при нажатии пользователем кнопки, например, открытие гиперссылки или запуск пользовательской функции. |
disabled | Если |
altText | Альтернативный текст, используемый для обеспечения доступности. Добавьте описательный текст, который даст пользователям понять, что делает кнопка. Например, если кнопка открывает гиперссылку, можно написать: «Открывает новую вкладку браузера и перенаправляет к документации разработчика Google Chat по адресу https://developers.google.com/workspace/chat» . |
type | Необязательный. Тип кнопки. Если не задано, тип кнопки по умолчанию — |
Тип
Необязательно. Тип кнопки. Если задано поле color , type принудительно устанавливается на FILLED .
Доступно для приложений Google Chat и недоступно для дополнений Google Workspace.
| Перечисления | |
|---|---|
TYPE_UNSPECIFIED | Не использовать. Не указано. |
OUTLINED | Выделенные кнопки — кнопки средней важности. Они обычно содержат важные действия, но не являются основными в приложении чата или дополнении. |
FILLED | Заполненная кнопка представляет собой контейнер со сплошным цветом. Она производит наиболее визуальное впечатление и рекомендуется для важных и основных действий в приложении чата или дополнении. |
FILLED_TONAL | Кнопка с заливкой и тоновым оформлением — это альтернативный вариант между кнопками с заливкой и кнопками с контуром. Они полезны в ситуациях, когда кнопка с низким приоритетом требует чуть большего внимания, чем кнопка с контуром. |
BORDERLESS | По умолчанию кнопка не имеет невидимого контейнера. Она часто используется для действий с самым низким приоритетом, особенно при наличии нескольких вариантов выбора. |
ButtonList
Список кнопок, расположенных горизонтально. Пример в приложениях Google Chat см. в разделе «Добавление кнопки» .
Доступно для приложений Google Chat и дополнений Google Workspace.
| Поля | |
|---|---|
buttons[] | Массив кнопок. |
Карта
Интерфейс карточки, отображаемый в сообщении Google Chat или дополнении Google Workspace.
Карточки поддерживают определённый макет, интерактивные элементы пользовательского интерфейса, такие как кнопки, и мультимедийные материалы, например, изображения. Используйте карточки для представления подробной информации, сбора информации от пользователей и подсказки им, как сделать следующий шаг.
Создавайте и просматривайте открытки с помощью Card Builder.
Откройте конструктор картЧтобы узнать, как создавать карты, ознакомьтесь со следующей документацией:
- Для приложений Google Chat см. раздел Разработка компонентов карточки или диалога .
- Информацию о дополнениях Google Workspace см. в разделе Интерфейсы на основе карт .
Примечание: Вы можете добавить до 100 виджетов на одну карточку. Любые виджеты, превышающие это ограничение, игнорируются. Это ограничение применяется как к сообщениям и диалогам в приложениях Google Chat, так и к карточкам в расширениях Google Workspace.
Пример: сообщение в карточке для приложения Google Chat

Чтобы создать пример сообщения-карточки в Google Chat, используйте следующий JSON:
{
"cardsV2": [
{
"cardId": "unique-card-id",
"card": {
"header": {
"title": "Sasha",
"subtitle": "Software Engineer",
"imageUrl":
"https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png",
"imageType": "CIRCLE",
"imageAltText": "Avatar for Sasha"
},
"sections": [
{
"header": "Contact Info",
"collapsible": true,
"uncollapsibleWidgetsCount": 1,
"widgets": [
{
"decoratedText": {
"startIcon": {
"knownIcon": "EMAIL"
},
"text": "sasha@example.com"
}
},
{
"decoratedText": {
"startIcon": {
"knownIcon": "PERSON"
},
"text": "<font color=\"#80e27e\">Online</font>"
}
},
{
"decoratedText": {
"startIcon": {
"knownIcon": "PHONE"
},
"text": "+1 (555) 555-1234"
}
},
{
"buttonList": {
"buttons": [
{
"text": "Share",
"onClick": {
"openLink": {
"url": "https://example.com/share"
}
}
},
{
"text": "Edit",
"onClick": {
"action": {
"function": "goToView",
"parameters": [
{
"key": "viewType",
"value": "EDIT"
}
]
}
}
}
]
}
}
]
}
]
}
}
]
}
| Поля | |
|---|---|
header | Заголовок карточки. Заголовок обычно содержит начальное изображение и название. Заголовки всегда располагаются в верхней части карточки. |
sections[] | Содержит набор виджетов. Каждый раздел имеет собственный заголовок (необязательно). Разделы визуально разделены линией-разделителем. Пример в приложениях Google Chat см. в разделе «Определение раздела карточки» . |
sectionDividerStyle | Стиль разделителя между заголовком, разделами и нижним колонтитулом. |
cardActions[] | Действия карты. Действия добавляются в меню панели инструментов карты.
Например, следующий JSON-код создает меню действий карточки с |
name | Название карты. Используется как идентификатор карты при навигации по ней.
|
fixedFooter | Фиксированный нижний колонтитул, показанный внизу этой карточки. Установка
|
displayStyle | В надстройках Google Workspace задает свойства отображения
|
peekCardHeader | При отображении контекстного контента заголовок всплывающей карточки действует как заполнители, позволяя пользователю перемещаться между карточками домашней страницы и контекстными карточками.
|
expressionData[] | Выражение данных для карты. Доступно для дополнений Google Workspace, расширяющих возможности Google Workspace, которые доступны в рамках программы Gemini Alpha . Недоступно для приложений Google Chat. |
CardAction
Действие с картой — это действие, связанное с картой. Например, карточка счёта может включать такие действия, как удаление счёта, отправка счёта по электронной почте или открытие счёта в браузере.
Доступно для дополнений Google Workspace и недоступно для приложений Google Chat.
| Поля | |
|---|---|
actionLabel | Метка, которая отображается как пункт меню действий. |
onClick | Действие |
CardHeader
Представляет заголовок карточки. Пример в приложениях Google Chat см. в разделе Добавление заголовка .
Доступно для приложений Google Chat и дополнений Google Workspace.
| Поля | |
|---|---|
title | Обязательно. Название заголовка карточки. Заголовок имеет фиксированную высоту: если указаны и заголовок, и подзаголовок, каждый занимает одну строку. Если указан только заголовок, он занимает обе строки. |
subtitle | Подзаголовок заголовка карточки. Если указан, отображается на отдельной строке под |
imageType | Форма, используемая для обрезки изображения.
|
imageUrl | HTTPS-URL изображения в заголовке карточки. |
imageAltText | Альтернативный текст этого изображения, используемый для обеспечения доступности. |
DisplayStyle
В дополнениях Google Workspace определяет способ отображения карточки.
Доступно для дополнений Google Workspace и недоступно для приложений Google Chat.
| Перечисления | |
|---|---|
DISPLAY_STYLE_UNSPECIFIED | Не использовать. Не указано. |
PEEK | Заголовок карты отображается внизу боковой панели, частично перекрывая текущую верхнюю карту в колоде. Щелчок по заголовку добавляет карту в колоду. Если у карты нет заголовка, вместо него используется сгенерированный заголовок. |
REPLACE | Значение по умолчанию. Карта отображается, заменяя вид верхней карты в стопке. |
DividerStyle
Разделитель для карточек. В настоящее время используется только для разделителей между секциями карточек.
Доступно для приложений Google Chat и дополнений Google Workspace.
| Перечисления | |
|---|---|
DIVIDER_STYLE_UNSPECIFIED | Не использовать. Не указано. |
SOLID_DIVIDER | Параметр по умолчанию. Отобразить сплошной разделитель. |
NO_DIVIDER | Если установлено, разделитель не отображается. Этот стиль полностью удаляет разделитель из макета. Результат эквивалентен отсутствию разделителя вообще. |
Вложенный виджет
Список виджетов, которые могут быть отображены в содержащем макете, например CarouselCard . Доступно для приложений Google Chat и недоступно для дополнений Google Workspace.
| Поля | |
|---|---|
| |
textParagraph | Виджет текстового абзаца. |
buttonList | Виджет списка кнопок. |
image | Виджет изображения. |
Раздел
Раздел содержит коллекцию виджетов, которые отображаются вертикально в том порядке, в котором они указаны.
Доступно для приложений Google Chat и дополнений Google Workspace.
| Поля | |
|---|---|
header | Текст, отображаемый в верхней части раздела. Поддерживает простой текст в формате HTML. Подробнее о форматировании текста см. в разделах Форматирование текста в приложениях Google Chat и Форматирование текста в расширениях Google Workspace . |
widgets[] | Все виджеты в разделе. Должен содержать хотя бы один виджет. |
collapsible | Указывает, является ли этот раздел сворачиваемым. Сворачиваемые разделы скрывают некоторые или все виджеты, но пользователи могут развернуть раздел, чтобы отобразить скрытые виджеты, нажав «Показать больше» . Пользователи могут снова скрыть виджеты, нажав «Показать меньше» . Чтобы определить, какие виджеты скрыты, укажите |
uncollapsibleWidgetsCount | Количество несворачиваемых виджетов, которые остаются видимыми даже при свертывании раздела. Например, если раздел содержит пять виджетов, а значение |
id | Уникальный идентификатор, назначенный разделу, который используется для идентификации раздела, подлежащего мутации. Идентификатор имеет ограничение по длине в 64 символа и должен иметь формат Доступно для дополнений Google Workspace, расширяющих возможности Google Workspace, которые доступны в рамках программы Gemini Alpha . Недоступно для приложений Google Chat. |
collapseControl | Необязательно. Задайте кнопку развёртывания и свёртывания раздела. Эта кнопка будет отображаться только если раздел можно свернуть. Если это поле не задано, будет использоваться кнопка по умолчанию. |
Видимость
Указывает, является ли элемент пользовательского интерфейса видимым или скрытым.
Доступно для дополнений Google Workspace, расширяющих возможности Google Workspace, которые доступны в рамках программы Gemini Alpha . Недоступно для приложений Google Chat.
| Перечисления | |
|---|---|
VISIBILITY_UNSPECIFIED | Видимость не указана. Не использовать. |
VISIBLE | Элемент пользовательского интерфейса виден. |
HIDDEN | Элемент пользовательского интерфейса скрыт. |
Карусель
Карусель, также известная как слайдер, вращается и отображает список виджетов в формате слайд-шоу с кнопками для перехода к предыдущему или следующему виджету.
Например, это JSON-представление карусели, содержащей три виджета текстовых абзацев.
{
"carouselCards": [
{
"widgets": [
{
"textParagraph": {
"text": "First text paragraph in carousel",
}
}
]
},
{
"widgets": [
{
"textParagraph": {
"text": "Second text paragraph in carousel",
}
}
]
},
{
"widgets": [
{
"textParagraph": {
"text": "Third text paragraph in carousel",
}
}
]
}
]
}
Доступно для приложений Google Chat и недоступно для дополнений Google Workspace.
| Поля | |
|---|---|
carouselCards[] | Список карточек, включенных в карусель. |
КарусельКарта
Карточка, которая может отображаться как элемент карусели. Доступно для приложений Google Chat и недоступно для дополнений Google Workspace.
| Поля | |
|---|---|
widgets[] | Список виджетов, отображаемых в карусели. Виджеты отображаются в том порядке, в котором они указаны. |
footerWidgets[] | Список виджетов, отображаемых в нижней части карточки карусели. Виджеты отображаются в том порядке, в котором они указаны. |
Чип
Текст, значок или чип с текстом и значком, на которые могут нажимать пользователи.
Доступно для приложений Google Chat и дополнений Google Workspace.
| Поля | |
|---|---|
icon | Изображение значка. Если заданы и |
label | Текст, отображаемый внутри чипа. |
onClick | Необязательно. Действие, которое нужно выполнить, когда пользователь нажимает на чип, например, открытие гиперссылки или запуск пользовательской функции. |
enabled | Находится ли чип в активном состоянии и реагирует ли на действия пользователя. Значение по умолчанию — |
disabled | Находится ли чип в неактивном состоянии и игнорирует действия пользователя. Значение по умолчанию — |
altText | Альтернативный текст, используемый для обеспечения доступности. Добавьте описательный текст, который расскажет пользователям, что делает чип. Например, если чип открывает гиперссылку, напишите: «Открывает новую вкладку браузера и перенаправляет к документации разработчика Google Chat по адресу https://developers.google.com/workspace/chat» . |
ChipList
Список фишек, расположенных горизонтально, который можно либо прокручивать горизонтально, либо переносить на следующую строку.
Доступно для приложений Google Chat и дополнений Google Workspace.
| Поля | |
|---|---|
layout | Указанный макет списка микросхем. |
chips[] | Массив фишек. |
Макет
Макет списка микросхем.
| Перечисления | |
|---|---|
LAYOUT_UNSPECIFIED | Не использовать. Не указано. |
WRAPPED | Значение по умолчанию. Список фишек переносится на следующую строку, если места по горизонтали недостаточно. |
HORIZONTAL_SCROLLABLE | Фишки прокручиваются горизонтально, если они не помещаются в отведенное им место. |
CollapseControl
Представляет собой элемент управления развертыванием и свертыванием.
Доступно для приложений Google Chat и дополнений Google Workspace.
| Поля | |
|---|---|
horizontalAlignment | Горизонтальное выравнивание кнопки развернуть и свернуть. |
expandButton | Необязательно. Создайте настраиваемую кнопку для развёртывания раздела. Необходимо задать поля expandButton и ColombiaButton. Только один набор полей не будет действовать. Если это поле не задано, будет использоваться кнопка по умолчанию. |
collapseButton | Необязательно. Создайте настраиваемую кнопку для сворачивания раздела. Необходимо задать оба поля: expandButton и ColombiaButton. Только один набор полей не будет действовать. Если это поле не задано, будет использоваться кнопка по умолчанию. |
Колонны
Виджет Columns отображает до двух столбцов в карточке или диалоговом окне. Вы можете добавлять виджеты в каждый столбец; они отображаются в указанном порядке. Пример в приложениях Google Chat см. в разделе Отображение карточек и диалоговых окон в столбцах .
Высота каждого столбца определяется высотой более высокого столбца. Например, если первый столбец выше второго, оба столбца будут иметь высоту первого столбца. Поскольку каждый столбец может содержать разное количество виджетов, невозможно определить строки или выровнять виджеты между столбцами.
Столбцы отображаются рядом друг с другом. Ширину каждого столбца можно настроить с помощью поля HorizontalSizeStyle . Если ширина экрана пользователя слишком узкая, второй столбец будет перенесен ниже первого:
- На веб-страницах второй столбец переносится, если ширина экрана меньше или равна 480 пикселям.
- На устройствах iOS второй столбец переносится, если ширина экрана меньше или равна 300 пт.
- На устройствах Android второй столбец переносится, если ширина экрана меньше или равна 320 dp.
Чтобы включить более двух столбцов или использовать строки, используйте виджет . Grid
Доступно для приложений Google Chat и дополнений Google Workspace. Интерфейсы дополнений, поддерживающие столбцы, включают:
- Диалоговое окно, отображаемое, когда пользователи открывают дополнение из черновика электронного письма.
- Диалоговое окно, отображаемое, когда пользователи открывают дополнение из меню «Добавить вложение» в событии Календаря Google.
| Поля | |
|---|---|
columnItems[] | Массив столбцов. В карточку или диалог можно включить до двух столбцов. |
Столбец
Колонка.
| Поля | |
|---|---|
horizontalSizeStyle | Определяет, как столбец заполняет ширину карточки. |
horizontalAlignment | Указывает, выравниваются ли виджеты по левому краю, правому краю или центру столбца. |
verticalAlignment | Указывает, выравниваются ли виджеты по верху, низу или центру столбца. |
widgets[] | Массив виджетов, включённых в столбец. Виджеты отображаются в том порядке, в котором они указаны. |
ГоризонтальныйРазмерСтиль
Определяет, как столбец заполняет ширину карточки. Ширина каждого столбца зависит как от свойства HorizontalSizeStyle , так и от ширины виджетов в столбце.
| Перечисления | |
|---|---|
HORIZONTAL_SIZE_STYLE_UNSPECIFIED | Не использовать. Не указано. |
FILL_AVAILABLE_SPACE | Значение по умолчанию. Столбец заполняет всё доступное пространство, до 70% ширины карточки. Если для обоих столбцов задано значение FILL_AVAILABLE_SPACE , каждый столбец заполняет 50% пространства. |
FILL_MINIMUM_SPACE | Столбец заполняет минимально возможное пространство и не более 30% ширины карточки. |
Вертикальное выравнивание
Указывает, выравниваются ли виджеты по верху, низу или центру столбца.
| Перечисления | |
|---|---|
VERTICAL_ALIGNMENT_UNSPECIFIED | Не использовать. Не указано. |
CENTER | Значение по умолчанию. Выравнивает виджеты по центру столбца. |
TOP | Выравнивает виджеты по верху столбца. |
BOTTOM | Выравнивает виджеты по низу столбца. |
Виджеты
Поддерживаемые виджеты, которые можно включить в столбец.
| Поля | |
|---|---|
| |
textParagraph | Виджет |
image | Виджет |
decoratedText | Виджет |
buttonList | Виджет |
textInput | Виджет |
selectionInput | Виджет |
dateTimePicker | Виджет |
chipList | Виджет |
Состояние
Представляет собой условие, которое может быть использовано для запуска действия.
Доступно для дополнений Google Workspace, расширяющих возможности Google Workspace, которые доступны в рамках программы Gemini Alpha . Недоступно для приложений Google Chat.
| Поля | |
|---|---|
actionRuleId | Уникальный идентификатор ActionRule. |
condition поля объединения. condition может быть только одним из следующих: | |
expressionDataCondition | Условие, которое определяется данными выражения. |
ВыражениеДанныеУсловие
Представляет собой состояние, которое оценивается с использованием CEL.
Доступно для дополнений Google Workspace, расширяющих возможности Google Workspace, которые доступны в рамках программы Gemini Alpha . Недоступно для приложений Google Chat.
| Поля | |
|---|---|
conditionType | Тип состояния. |
ConditionType
Тип состояния.
| Перечисления | |
|---|---|
CONDITION_TYPE_UNSPECIFIED | Неуказанный тип состояния. |
EXPRESSION_EVALUATION_SUCCESS | Оценка выражения прошла успешно. |
EXPRESSION_EVALUATION_FAILURE | Оценка выражения не удалась. |
DataActions
Дополнительное действие , обновляющее данные Google Workspace.
| Поля | |
|---|---|
hostAppDataAction | Определяет, как обновлять данные Google Workspace. |
DataSourceConfig
Объект конфигурации, который помогает настраивать источники данных для виджета.
Доступно для дополнений Google Workspace, расширяющих возможности Google Workspace, которые доступны в рамках программы Gemini Alpha . Недоступно для приложений Google Chat.
| Поля | |
|---|---|
Поле объединения data_source . Источник данных data_source может быть только одним из следующих: | |
remoteDataSource | Данные получены от удаленного поставщика данных. |
platformDataSource | Данные взяты из приложения Google Workspace. |
DateTimePicker
Позволяет пользователям вводить дату, время или и дату, и время одновременно. Поддерживает валидацию отправки форм. Если для Action.all_widgets_are_required задано значение true или этот виджет указан в Action.required_widgets , отправка блокируется, если не выбрано значение. Пример в приложениях Google Chat см. в разделе «Разрешить пользователю выбирать дату и время» .
Пользователи могут вводить текст или использовать поле выбора для выбора даты и времени. Если пользователь вводит неверную дату или время, поле выбора отображает ошибку с предложением ввести правильную информацию.
Доступно для приложений Google Chat и дополнений Google Workspace.
| Поля | |
|---|---|
name | Имя, по которому Подробную информацию о работе с данными формы см. в разделе Получение данных формы . |
label | Текст, предлагающий пользователям ввести дату, время или дату и время. Например, если пользователи планируют встречу, используйте метку, например |
type | Поддерживает ли виджет ввод даты, времени или даты и времени. |
valueMsEpoch | Значение по умолчанию, отображаемое в виджете, в миллисекундах с начала эпохи Unix . Укажите значение на основе типа выбора (
|
timezoneOffsetDate | Число, представляющее смещение часового пояса относительно UTC в минутах. Если задано, |
onChangeAction | Срабатывает, когда пользователь нажимает кнопку «Сохранить» или «Очистить» в интерфейсе |
Поле объединения data_source . Источник данных, указанный для представления даты и времени. data_source может быть только одним из следующих: | |
hostAppDataSource | Источник данных, уникальный для хост-приложения Google Workspace, например электронные письма Gmail, события Google Календаря или сообщения Google Chat. Доступно для дополнений Google Workspace, расширяющих возможности Google Workspace, которые доступны в рамках программы Gemini Alpha . Недоступно для приложений Google Chat. |
DateTimePickerType
Формат даты и времени в виджете DateTimePicker . Определяет, могут ли пользователи вводить дату, время или и то, и другое.
Доступно для приложений Google Chat и дополнений Google Workspace.
| Перечисления | |
|---|---|
DATE_AND_TIME | Пользователи вводят дату и время. |
DATE_ONLY | Пользователи вводят дату. |
TIME_ONLY | Пользователи вводят время. |
DecoratedText
Виджет, отображающий текст с дополнительными элементами декора, такими как метка над или под текстом, значок перед текстом, виджет выбора или кнопка после текста. Пример в приложениях Google Chat см. в разделе Отображение текста с декоративным текстом .
Доступно для приложений Google Chat и дополнений Google Workspace.
| Поля | |
|---|---|
icon | Устарело в пользу |
startIcon | Значок, отображаемый перед текстом. |
startIconVerticalAlignment | Необязательно. Вертикальное выравнивание значка «Пуск». Если не задано, значок будет выровнен по центру.
|
topLabel | Текст, отображаемый над |
topLabelText |
|
text | Обязательно. Основной текст. Поддерживает простое форматирование. Подробнее о форматировании текста см. в разделах Форматирование текста в приложениях Google Chat и Форматирование текста в расширениях Google Workspace . |
contentText |
|
wrapText | Настройка переноса текста. Если Применяется только к |
bottomLabel | Текст, отображаемый под |
bottomLabelText |
|
onClick | Это действие запускается, когда пользователи нажимают |
control полем объединения. Кнопка, переключатель, флажок или изображение, отображаемые справа от текста в виджете decoratedText . control может быть только одним из следующих: | |
button | Кнопка, которую пользователь может нажать, чтобы запустить действие. |
switchControl | Виджет-переключатель, на который пользователь может нажать, чтобы изменить его состояние и запустить действие. |
endIcon | Значок, отображаемый после текста. Поддерживает встроенные и пользовательские значки. |
SwitchControl
Либо переключатель в виде тумблера, либо флажок внутри виджета decoratedText .
Доступно для приложений Google Chat и дополнений Google Workspace.
Поддерживается только в виджете decoratedText .
| Поля | |
|---|---|
name | Имя, по которому виджет-переключатель идентифицируется в событии ввода формы. Подробную информацию о работе с данными формы см. в разделе Получение данных формы . |
value | Значение, введенное пользователем, возвращается как часть события ввода формы. Подробную информацию о работе с данными формы см. в разделе Получение данных формы . |
selected | Если |
onChangeAction | Действие, которое следует выполнить при изменении состояния переключателя, например, какую функцию следует запустить. |
controlType | Как выглядит переключатель в пользовательском интерфейсе.
|
Тип управления
Как выглядит переключатель в пользовательском интерфейсе.
Доступно для приложений Google Chat и дополнений Google Workspace.
| Перечисления | |
|---|---|
SWITCH | Переключатель тумблерного типа. |
CHECKBOX | Устарело в пользу CHECK_BOX . |
CHECK_BOX | Флажок. |
Разделитель
Этот тип не имеет полей.
Отображает разделитель между виджетами в виде горизонтальной линии. Пример в приложениях Google Chat см. в разделе Добавление горизонтального разделителя между виджетами .
Доступно для приложений Google Chat и дополнений Google Workspace.
Например, следующий JSON-код создает разделитель:
"divider": {}
СобытиеДействие
Представляет действие, которое можно выполнить над элементом пользовательского интерфейса.
Доступно для дополнений Google Workspace, расширяющих возможности Google Workspace, которые доступны в рамках программы Gemini Alpha . Недоступно для приложений Google Chat.
| Поля | |
|---|---|
actionRuleId | Уникальный идентификатор ActionRule. |
postEventTriggers[] | Список триггеров, которые будут активированы после выполнения EventAction. |
Union field action . The action to perform. action can be only one of the following: | |
commonWidgetAction | Common widget action. |
CommonWidgetAction
Represents an action that is not specific to a widget.
Available for Google Workspace add-ons that extend Google Workspace flows, which is available as part of the Gemini Alpha program . Unavailable for Google Chat apps.
| Поля | |
|---|---|
Union field action . The action to perform. action can be only one of the following: | |
updateVisibilityAction | The action to update the visibility of a widget. |
UpdateVisibilityAction
Represents an action that updates the visibility of a widget.
Available for Google Workspace add-ons that extend Google Workspace flows, which is available as part of the Gemini Alpha program . Unavailable for Google Chat apps.
| Поля | |
|---|---|
visibility | The new visibility. |
ExpressionData
Represents the data that is used to evaluate an expression.
Available for Google Workspace add-ons that extend Google Workspace flows, which is available as part of the Gemini Alpha program . Unavailable for Google Chat apps.
| Поля | |
|---|---|
id | The unique identifier of the ExpressionData. |
expression | The uncompiled expression. |
conditions[] | The list of conditions that are determined by the expression evaluation result. |
eventActions[] | The list of actions that the ExpressionData can be used. |
GetAutocompletionResponse
A response to getting autocomplete container, which includes elements necessary for showing auto complete items for text field.
Available for Google Workspace add-ons and unavailable for Google Chat apps. For example:
{
"autoComplete": {
"items": [
{
"text": "C++"
},
{
"text": "Java"
},
{
"text": "JavaScript"
},
{
"text": "Python"
}
]
}
}
| Поля | |
|---|---|
autoComplete | |
schema | This is a no-op schema field that might be present in the markup for syntax checking. |
Сетка
Displays a grid with a collection of items. Items can only include text or images. For responsive columns, or to include more than text or images, use . For an example in Google Chat apps, see Display a Grid with a collection of items .Columns
A grid supports any number of columns and items. The number of rows is determined by items divided by columns. A grid with 10 items and 2 columns has 5 rows. A grid with 11 items and 2 columns has 6 rows.
Available for Google Chat apps and Google Workspace add-ons.
For example, the following JSON creates a 2 column grid with a single item:
"grid": {
"title": "A fine collection of items",
"columnCount": 2,
"borderStyle": {
"type": "STROKE",
"cornerRadius": 4
},
"items": [
{
"image": {
"imageUri": "https://www.example.com/image.png",
"cropStyle": {
"type": "SQUARE"
},
"borderStyle": {
"type": "STROKE"
}
},
"title": "An item",
"textAlignment": "CENTER"
}
],
"onClick": {
"openLink": {
"url": "https://www.example.com"
}
}
}
| Поля | |
|---|---|
title | The text that displays in the grid header. |
items[] | The items to display in the grid. |
borderStyle | The border style to apply to each grid item. |
columnCount | The number of columns to display in the grid. A default value is used if this field isn't specified, and that default value is different depending on where the grid is shown (dialog versus companion). |
onClick | This callback is reused by each individual grid item, but with the item's identifier and index in the items list added to the callback's parameters. |
GridItem
Represents an item in a grid layout. Items can contain text, an image, or both text and an image.
Available for Google Chat apps and Google Workspace add-ons.
| Поля | |
|---|---|
id | A user-specified identifier for this grid item. This identifier is returned in the parent grid's |
image | The image that displays in the grid item. |
title | The grid item's title. |
subtitle | The grid item's subtitle. |
layout | The layout to use for the grid item. |
GridItemLayout
Represents the various layout options available for a grid item.
Available for Google Chat apps and Google Workspace add-ons.
| Перечисления | |
|---|---|
GRID_ITEM_LAYOUT_UNSPECIFIED | Don't use. Unspecified. |
TEXT_BELOW | The title and subtitle are shown below the grid item's image. |
TEXT_ABOVE | The title and subtitle are shown above the grid item's image. |
Икона
An icon displayed in a widget on a card. For an example in Google Chat apps, see Add an icon .
Supports built-in and custom icons.
Available for Google Chat apps and Google Workspace add-ons.
| Поля | |
|---|---|
altText | Optional. A description of the icon used for accessibility. If unspecified, the default value If the icon is set in a |
imageType | The crop style applied to the image. In some cases, applying a |
Union field icons . The icon displayed in the widget on the card. icons can be only one of the following: | |
knownIcon | Display one of the built-in icons provided by Google Workspace. For example, to display an airplane icon, specify For a full list of supported icons, see built-in icons . |
iconUrl | Display a custom icon hosted at an HTTPS URL. Например: Supported file types include |
materialIcon | Display one of the Google Material Icons . For example, to display a checkbox icon , use
|
Изображение
An image that is specified by a URL and can have an onClick action. For an example, see Add an image .
Available for Google Chat apps and Google Workspace add-ons.
| Поля | |
|---|---|
imageUrl | The HTTPS URL that hosts the image. Например: |
onClick | When a user clicks the image, the click triggers this action. |
altText | The alternative text of this image that's used for accessibility. |
ImageComponent
Represents an image.
Available for Google Chat apps and Google Workspace add-ons.
| Поля | |
|---|---|
imageUri | The image URL. |
altText | The accessibility label for the image. |
cropStyle | The crop style to apply to the image. |
borderStyle | The border style to apply to the image. |
ImageCropStyle
Represents the crop style applied to an image.
Available for Google Chat apps and Google Workspace add-ons.
For example, here's how to apply a 16:9 aspect ratio:
cropStyle {
"type": "RECTANGLE_CUSTOM",
"aspectRatio": 16/9
}
| Поля | |
|---|---|
type | The crop type. |
aspectRatio | The aspect ratio to use if the crop type is For example, here's how to apply a 16:9 aspect ratio: |
ImageCropType
Represents the crop style applied to an image.
Available for Google Chat apps and Google Workspace add-ons.
| Перечисления | |
|---|---|
IMAGE_CROP_TYPE_UNSPECIFIED | Don't use. Unspecified. |
SQUARE | Default value. Applies a square crop. |
CIRCLE | Applies a circular crop. |
RECTANGLE_CUSTOM | Applies a rectangular crop with a custom aspect ratio. Set the custom aspect ratio with aspectRatio . |
RECTANGLE_4_3 | Applies a rectangular crop with a 4:3 aspect ratio. |
Связь
The link object for the third-party resource that's returned to the add-on. For more information, see Create third-party resources from the @ menu .
Available for Google Workspace add-ons and unavailable for Google Chat apps.
| Поля | |
|---|---|
url | URL of the link to return to the add-on. |
title | Title of the link to return to the add-on. |
LinkPreview
Card action that previews a third-party link by displaying a card and smart chip. To learn more, see Preview links with smart chips .
Available for Google Workspace add-ons and unavailable for Google Chat apps.
For example, the following JSON returns a unique title for the link preview and its smart chip, and a preview card with a header and text description:
{
"action": {
"linkPreview": {
"title": "Smart chip title",
"linkPreviewTitle": "Link preview title",
"previewCard": {
"header": {
"title": "Preview card header",
},
"sections": [
{
"widgets": [
{
"textParagraph": {
"text": "Description of the link."
}
}
]
}
]
}
}
}
}
The example returns the following link preview:

| Поля | |
|---|---|
previewCard | A card that displays information about a link from a third-party service. |
title | The title that displays in the smart chip for the link preview. If unset, the smart chip displays the header of the |
linkPreviewTitle | The title that displays in the link preview. If unset, the link preview displays the header of the |
MaterialIcon
A Google Material Icon , which includes over 2500+ options.
For example, to display a checkbox icon with customized weight and grade, write the following:
{
"name": "check_box",
"fill": true,
"weight": 300,
"grade": -25
}
Available for Google Chat apps and unavailable for Google Workspace add-ons.
| Поля | |
|---|---|
name | The icon name defined in the Google Material Icon , for example, |
fill | Whether the icon renders as filled. Default value is false. To preview different icon settings, go to Google Font Icons and adjust the settings under Customize . |
weight | The stroke weight of the icon. Choose from {100, 200, 300, 400, 500, 600, 700}. If absent, default value is 400. If any other value is specified, the default value is used. To preview different icon settings, go to Google Font Icons and adjust the settings under Customize . |
grade | Weight and grade affect a symbol's thickness. Adjustments to grade are more granular than adjustments to weight and have a small impact on the size of the symbol. Choose from {-25, 0, 200}. If absent, default value is 0. If any other value is specified, the default value is used. To preview different icon settings, go to Google Font Icons and adjust the settings under Customize . |
ModifyCard
For add-ons in Google Chat , updates a card based on a user interaction. The array must only contain a single object.
| Поля | |
|---|---|
Union field operation . The operation to perform. operation can be only one of the following: | |
updateWidget | For add-ons in Google Chat , updates a widget in a card or dialog. |
UpdateWidget
For add-ons in Google Chat , updates a widget in a card or dialog. It is used for providing auto-complete suggestions when user types in an input box. See Suggest multiselect items for more details.
| Поля | |
|---|---|
Union field updated_widget . The updates to a widget. updated_widget can be only one of the following: | |
selectionInputWidgetSuggestions | For |
SelectionInputWidgetSuggestions
For a selectionInput widget that uses a multiselect menu, returns selection items from an external dynamic data source.
| Поля | |
|---|---|
suggestions[] | An array of selectable items that appear to a user after they type into a multiselect menu. |
Уведомление
An action that displays a notification in the host Google Workspace application when a user interacts with a card.
For add-ons in Google Chat , displays a notification when users submit and close a dialog .
Available for Google Workspace add-ons and unavailable for Google Chat apps.
| Поля | |
|---|---|
text | Plain text to display for the notification, without HTML tags. |
OnClick
Represents how to respond when users click an interactive element on a card, such as a button.
Available for Google Chat apps and Google Workspace add-ons.
| Поля | |
|---|---|
Union field | |
action | If specified, an action is triggered by this |
openLink | If specified, this |
openDynamicLinkAction | An add-on triggers this action when the action needs to open a link. This differs from the
|
card | A new card is pushed to the card stack after clicking if specified.
|
overflowMenu | If specified, this |
OpenLink
Represents an onClick event that opens a hyperlink.
Available for Google Chat apps and Google Workspace add-ons.
| Поля | |
|---|---|
url | The URL to open. |
openAs | How to open a link.
|
onClose | Whether the client forgets about a link after opening it, or observes it until the window closes.
|
OnClose
What the client does when a link opened by an OnClick action is closed.
Implementation depends on client platform capabilities. For example, a web browser might open a link in a pop-up window with an OnClose handler.
If both OnOpen and OnClose handlers are set, and the client platform can't support both values, OnClose takes precedence.
Available for Google Workspace add-ons and unavailable for Google Chat apps.
| Перечисления | |
|---|---|
NOTHING | Default value. The card doesn't reload; nothing happens. |
RELOAD | Reloads the card after the child window closes. If used in conjunction with |
OpenAs
When an OnClick action opens a link, then the client can either open it as a full-size window (if that's the frame used by the client), or an overlay (such as a pop-up). The implementation depends on the client platform capabilities, and the value selected might be ignored if the client doesn't support it. FULL_SIZE is supported by all clients.
Available for Google Workspace add-ons and unavailable for Google Chat apps.
| Перечисления | |
|---|---|
FULL_SIZE | The link opens as a full-size window (if that's the frame used by the client). |
OVERLAY | The link opens as an overlay, such as a pop-up. |
OverflowMenu
A widget that presents a pop-up menu with one or more actions that users can invoke. For example, showing non-primary actions in a card. You can use this widget when actions don't fit in the available space. To use, specify this widget in the OnClick action of widgets that support it. For example, in a Button .
Available for Google Chat apps and Google Workspace add-ons.
| Поля | |
|---|---|
items[] | Required. The list of menu options. |
OverflowMenuItem
An option that users can invoke in an overflow menu.
Available for Google Chat apps and Google Workspace add-ons.
| Поля | |
|---|---|
startIcon | The icon displayed in front of the text. |
text | Required. The text that identifies or describes the item to users. |
onClick | Required. The action invoked when a menu option is selected. This |
disabled | Whether the menu option is disabled. Defaults to false. |
RenderActions
A set of render instructions that tells a host application how to render a card or perform an action in response to a user interaction.
Available for Google Workspace add-ons and unavailable for Google Chat apps.
| Поля | |
|---|---|
action | The action that add-ons can use to update the UI. |
hostAppAction | Actions handled by individual host apps. |
schema | This is a no-op schema field that might be present in the markup for syntax checking. |
Действие
The actions that add-ons can use in cards or the host application.
Available for Google Workspace add-ons and unavailable for Google Chat apps.
| Поля | |
|---|---|
navigations[] | Pushes, pops, or updates a card. |
link | Opens the target link in a new tab or pop-up window. |
notification | Displays a notification in the host Google Workspace application when a user interacts with a card. For add-ons in Google Chat , displays a notification when users submit and close a dialog . |
linkPreview | Available in Google Docs, Google Sheets, and Google Slides. Previews links with smart chips and card. For details, see Preview links with smart chips . |
links[] | Available in Google Docs. Returns a link from a third-party resource and converts it to a smart chip in the host application. Formatted as an array of objects with one item. For more information, see Create third-party resources from the @ menu . |
modifyOperations[] | For add-ons in Google Chat , updates a card based on a user interaction. The array must only contain a single object. |
SelectionInput
A widget that creates one or more UI items that users can select. Supports form submission validation for dropdown and multiselect menus only. When Action.all_widgets_are_required is set to true or this widget is specified in Action.required_widgets , the submission action is blocked unless a value is selected. For example, a dropdown menu or checkboxes. You can use this widget to collect data that can be predicted or enumerated. For an example in Google Chat apps, see Add selectable UI elements .
Chat apps can process the value of items that users select or input. For details about working with form inputs, see Receive form data .
To collect undefined or abstract data from users, use the TextInput widget.
Available for Google Chat apps and Google Workspace add-ons.
| Поля | |
|---|---|
name | Required. The name that identifies the selection input in a form input event. For details about working with form inputs, see Receive form data . |
label | The text that appears above the selection input field in the user interface. Specify text that helps the user enter the information your app needs. For example, if users are selecting the urgency of a work ticket from a drop-down menu, the label might be "Urgency" or "Select urgency". |
type | The type of items that are displayed to users in a |
items[] | An array of selectable items. For example, an array of radio buttons or checkboxes. Supports up to 100 items. |
onChangeAction | If specified, the form is submitted when the selection changes. If not specified, you must specify a separate button that submits the form. For details about working with form inputs, see Receive form data . |
multiSelectMinQueryLength | For multiselect menus, the number of text characters that a user inputs before the menu returns suggested selection items. If unset, the multiselect menu uses the following default values:
|
dataSourceConfigs[] | Optional. The data source configs for the selection control. This field provides more fine-grained control over the data source. If specified, the Available for Google Workspace add-ons that extend Google Workspace flows, which is available as part of the Gemini Alpha program . Unavailable for Google Chat apps. |
multiSelectMaxSelectedItems | For multiselect menus, the maximum number of items that a user can select. Minimum value is 1 item. If unspecified, defaults to 3 items. |
hintText | Optional. Text that appears below the selection input field meant to assist users by prompting them to enter a certain value. This text is always visible. Available for Google Workspace add-ons that extend Google Workspace flows, which is available as part of the Gemini Alpha program . Unavailable for Google Chat apps. |
Union field
| |
externalDataSource | An external data source, such as a relational database. |
platformDataSource | A data source from Google Workspace. |
PlatformDataSource
For a widget that uses a multiselect menu, a data source from Google Workspace. Used to populate items in a multiselect menu. SelectionInput
Available for Google Chat apps and unavailable for Google Workspace add-ons.
| Поля | |
|---|---|
Union field data_source . The data source. data_source can be only one of the following: | |
commonDataSource | A data source shared by all Google Workspace applications, such as users in a Google Workspace organization. |
hostAppDataSource | A data source that's unique to a Google Workspace host application, such spaces in Google Chat. This field supports the Google API Client Libraries but isn't available in the Cloud Client Libraries. To learn more, see Install the client libraries . |
CommonDataSource
A data source shared by all Google Workspace applications .
Available for Google Chat apps and unavailable for Google Workspace add-ons.
| Перечисления | |
|---|---|
UNKNOWN | Default value. Don't use. |
USER | Google Workspace users. The user can only view and select users from their Google Workspace organization. |
SelectionItem
An item that users can select in a selection input, such as a checkbox or switch. Supports up to 100 items.
Available for Google Chat apps and Google Workspace add-ons.
| Поля | |
|---|---|
text | The text that identifies or describes the item to users. |
value | The value associated with this item. The client should use this as a form input value. For details about working with form inputs, see Receive form data . |
selected | Whether the item is selected by default. If the selection input only accepts one value (such as for radio buttons or a dropdown menu), only set this field for one item. |
bottomText | For multiselect menus, a text description or label that's displayed below the item's |
Union field startIcon . For multiselect menus, the URL for the icon displayed next to the item's text field. Supports PNG and JPEG files. Must be an HTTPS URL. For example, https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png . startIcon can be only one of the following: | |
startIconUri | |
SelectionType
The format for the items that users can select. Different options support different types of interactions. For example, users can select multiple checkboxes, but can only select one item from a dropdown menu.
Each selection input supports one type of selection. Mixing checkboxes and switches, for example, isn't supported.
Available for Google Chat apps and Google Workspace add-ons.
| Перечисления | |
|---|---|
CHECK_BOX | A set of checkboxes. Users can select one or more checkboxes. |
RADIO_BUTTON | A set of radio buttons. Users can select one radio button. |
SWITCH | A set of switches. Users can turn on one or more switches. |
DROPDOWN | A dropdown menu. Users can select one item from the menu. |
MULTI_SELECT | A menu with a text box. Users can type and select one or more items. For Google Workspace add-ons, you must populate items using a static array of For Google Chat apps, you can also populate items using a dynamic data source and autosuggest items as users type in the menu. For example, users can start typing the name of a Google Chat space and the widget autosuggests the space. To dynamically populate items for a multiselect menu, use one of the following types of data sources:
For examples of how to implement multiselect menus for Chat apps, see Add a multiselect menu .
|
SubmitFormResponse
A response to a form submit other than getting an autocomplete container, which contains the actions the card should perform and/or the add-on host app should perform, and whether the card's state has changed.
Available for Google Workspace add-ons and unavailable for Google Chat apps. For example:
{
"renderActions": {
"action": {
"notification": {
"text": "Email address is added: salam.heba@example.com"
}
},
"hostAppAction": {
"gmailAction": {
"openCreatedDraftAction": {
"draftId": "msg-a:r-79766936926021702",
"threadServerPermId": "thread-f:15700999851086004"
}
}
}
}
}
| Поля | |
|---|---|
renderActions | A set of render instructions that tells the card to perform an action and/or tells the add-on host app to perform an app-specific action. |
stateChanged | Whether the state of the cards has changed and data in existing cards is stale. |
schema | This is a no-op schema field that may be present in the markup for syntax checking. |
Предложения
Suggested values that users can enter. These values appear when users click inside the text input field. As users type, the suggested values dynamically filter to match what the users have typed.
For example, a text input field for programming language might suggest Java, JavaScript, Python, and C++. When users start typing Jav , the list of suggestions filters to show Java and JavaScript .
Suggested values help guide users to enter values that your app can make sense of. When referring to JavaScript, some users might enter javascript and others java script . Suggesting JavaScript can standardize how users interact with your app.
When specified, TextInput.type is always SINGLE_LINE , even if it's set to MULTIPLE_LINE .
Available for Google Chat apps and Google Workspace add-ons.
| Поля | |
|---|---|
items[] | A list of suggestions used for autocomplete recommendations in text input fields. |
SuggestionItem
One suggested value that users can enter in a text input field.
Available for Google Chat apps and Google Workspace add-ons.
| Поля | |
|---|---|
Union field | |
text | The value of a suggested input to a text input field. This is equivalent to what users enter themselves. |
TextInput
A field in which users can enter text. Supports suggestions and on-change actions. Supports form submission validation. When Action.all_widgets_are_required is set to true or this widget is specified in Action.required_widgets , the submission action is blocked unless a value is entered. For an example in Google Chat apps, see Add a field in which a user can enter text .
Chat apps receive and can process the value of entered text during form input events. For details about working with form inputs, see Receive form data .
When you need to collect undefined or abstract data from users, use a text input. To collect defined or enumerated data from users, use the SelectionInput widget.
Available for Google Chat apps and Google Workspace add-ons.
| Поля | |
|---|---|
name | The name by which the text input is identified in a form input event. For details about working with form inputs, see Receive form data . |
label | The text that appears above the text input field in the user interface. Specify text that helps the user enter the information your app needs. For example, if you are asking someone's name, but specifically need their surname, write Required if |
hintText | Text that appears below the text input field meant to assist users by prompting them to enter a certain value. This text is always visible. Required if |
value | The value entered by a user, returned as part of a form input event. For details about working with form inputs, see Receive form data . |
type | How a text input field appears in the user interface. For example, whether the field is single or multi-line. |
onChangeAction | What to do when a change occurs in the text input field. For example, a user adding to the field or deleting text. Examples of actions to take include running a custom function or opening a dialog in Google Chat. |
initialSuggestions | Suggested values that users can enter. These values appear when users click inside the text input field. As users type, the suggested values dynamically filter to match what the users have typed. For example, a text input field for programming language might suggest Java, JavaScript, Python, and C++. When users start typing Suggested values help guide users to enter values that your app can make sense of. When referring to JavaScript, some users might enter When specified,
|
autoCompleteAction | Optional. Specify what action to take when the text input field provides suggestions to users who interact with it. If unspecified, the suggestions are set by If specified, the app takes the action specified here, such as running a custom function.
|
validation | Specify the input format validation necessary for this text field.
|
placeholderText | Text that appears in the text input field when the field is empty. Use this text to prompt users to enter a value. For example,
|
Union field | |
hostAppDataSource | A data source that's unique to a Google Workspace host application, such as Gmail emails, Google Calendar events, or Google Chat messages. Available for Google Workspace add-ons that extend Google Workspace flows, which is available as part of the Gemini Alpha program . Unavailable for Google Chat apps. |
Тип
How a text input field appears in the user interface. For example, whether it's a single line input field, or a multi-line input. If initialSuggestions is specified, type is always SINGLE_LINE , even if it's set to MULTIPLE_LINE .
Available for Google Chat apps and Google Workspace add-ons.
| Перечисления | |
|---|---|
SINGLE_LINE | The text input field has a fixed height of one line. |
MULTIPLE_LINE | The text input field has a fixed height of multiple lines. |
TextParagraph
A paragraph of text that supports formatting. For an example in Google Chat apps, see Add a paragraph of formatted text . For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace add-ons .
Available for Google Chat apps and Google Workspace add-ons.
| Поля | |
|---|---|
text | The text that's shown in the widget. |
maxLines | The maximum number of lines of text that are displayed in the widget. If the text exceeds the specified maximum number of lines, the excess content is concealed behind a show more button. If the text is equal or shorter than the specified maximum number of lines, a show more button isn't displayed. The default value is 0, in which case all context is displayed. Negative values are ignored. |
textSyntax | The syntax of the text. If not set, the text is rendered as HTML.
|
TextSyntax
Syntax to use for formatting text.
Available for Google Chat apps and unavailable for Google Workspace add-ons.
| Перечисления | |
|---|---|
TEXT_SYNTAX_UNSPECIFIED | The text is rendered as HTML if unspecified. |
HTML | The text is rendered as HTML. This is the default value. |
MARKDOWN | The text is rendered as Markdown. |
Курок
Represents a trigger.
Available for Google Workspace add-ons that extend Google Workspace flows, which is available as part of the Gemini Alpha program . Unavailable for Google Chat apps.
| Поля | |
|---|---|
actionRuleId | The unique identifier of the ActionRule. |
Проверка
Represents the necessary data for validating the widget it's attached to.
Available for Google Chat apps and Google Workspace add-ons.
| Поля | |
|---|---|
characterLimit | Specify the character limit for text input widgets. Note that this is only used for text input and is ignored for other widgets.
|
inputType | Specify the type of the input widgets.
|
InputType
The type of the input widget.
| Перечисления | |
|---|---|
INPUT_TYPE_UNSPECIFIED | Unspecified type. Do not use. |
TEXT | Regular text that accepts all characters. |
INTEGER | Целочисленное значение. |
FLOAT | A float value. |
EMAIL | An email address. |
EMOJI_PICKER | A emoji selected from system-provided emoji picker. |
Виджет
Each card is made up of widgets.
A widget is a composite object that can represent one of text, images, buttons, and other object types.
| Поля | |
|---|---|
horizontalAlignment | Specifies whether widgets align to the left, right, or center of a column. |
id | A unique ID assigned to the widget that's used to identify the widget to be mutated. The ID has a character limit of 64 characters and should be in the format of Available for Google Workspace add-ons that extend Google Workspace flows, which is available as part of the Gemini Alpha program . Unavailable for Google Chat apps. |
visibility | Specifies whether the widget is visible or hidden. The default value is Available for Google Workspace add-ons that extend Google Workspace flows, which is available as part of the Gemini Alpha program . Unavailable for Google Chat apps. |
eventActions[] | Specifies the event actions that can be performed on the widget. Available for Google Workspace add-ons that extend Google Workspace flows, which is available as part of the Gemini Alpha program . Unavailable for Google Chat apps. |
Union field data . A widget can only have one of the following items. You can use multiple widget fields to display more items. data can be only one of the following: | |
textParagraph | Displays a text paragraph. Supports simple HTML formatted text. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace add-ons . For example, the following JSON creates a bolded text: |
image | Отображает изображение. For example, the following JSON creates an image with alternative text: |
decoratedText | Displays a decorated text item. For example, the following JSON creates a decorated text widget showing email address: |
buttonList | A list of buttons. For example, the following JSON creates two buttons. The first is a blue text button and the second is an image button that opens a link: |
textInput | Displays a text box that users can type into. For example, the following JSON creates a text input for an email address: As another example, the following JSON creates a text input for a programming language with static suggestions: |
selectionInput | Displays a selection control that lets users select items. Selection controls can be checkboxes, radio buttons, switches, or dropdown menus. For example, the following JSON creates a dropdown menu that lets users choose a size: |
dateTimePicker | Displays a widget that lets users input a date, time, or date and time. For example, the following JSON creates a date time picker to schedule an appointment: |
divider | Displays a horizontal line divider between widgets. For example, the following JSON creates a divider: |
grid | Displays a grid with a collection of items. A grid supports any number of columns and items. The number of rows is determined by the upper bounds of the number items divided by the number of columns. A grid with 10 items and 2 columns has 5 rows. A grid with 11 items and 2 columns has 6 rows.
For example, the following JSON creates a 2 column grid with a single item: |
columns | Displays up to 2 columns. To include more than 2 columns, or to use rows, use the For example, the following JSON creates 2 columns that each contain text paragraphs: |
carousel | A carousel contains a collection of nested widgets. For example, this is a JSON representation of a carousel that contains two text paragraphs. |
chipList | A list of chips. For example, the following JSON creates two chips. The first is a text chip and the second is an icon chip that opens a link: |
Горизонтальное выравнивание
Specifies whether widgets align to the left, right, or center of a column.
Available for Google Chat apps and unavailable for Google Workspace add-ons.
| Перечисления | |
|---|---|
HORIZONTAL_ALIGNMENT_UNSPECIFIED | Don't use. Unspecified. |
START | Default value. Aligns widgets to the start position of the column. For left-to-right layouts, aligns to the left. For right-to-left layouts, aligns to the right. |
CENTER | Aligns widgets to the center of the column. |
END | Aligns widgets to the end position of the column. For left-to-right layouts, aligns widgets to the right. For right-to-left layouts, aligns widgets to the left. |
Тип изображения
The shape used to crop the image.
Available for Google Chat apps and Google Workspace add-ons.
| Перечисления | |
|---|---|
SQUARE | Default value. Applies a square mask to the image. For example, a 4x3 image becomes 3x3. |
CIRCLE | Applies a circular mask to the image. For example, a 4x3 image becomes a circle with a diameter of 3. |
Вертикальное выравнивание
Represents vertical alignment attribute.
| Перечисления | |
|---|---|
VERTICAL_ALIGNMENT_UNSPECIFIED | Unspecified type. Do not use. |
TOP | Alignment to the top position. |
MIDDLE | Alignment to the middle position. |
BOTTOM | Alignment to the bottom position. |