- [JSON representation](https://developers.google.com/workspace/chat/api/reference/rest/v1/Action#SCHEMA_REPRESENTATION)
- [ActionParameter](https://developers.google.com/workspace/chat/api/reference/rest/v1/Action#ActionParameter)
  - [JSON representation](https://developers.google.com/workspace/chat/api/reference/rest/v1/Action#ActionParameter.SCHEMA_REPRESENTATION)
- [LoadIndicator](https://developers.google.com/workspace/chat/api/reference/rest/v1/Action#LoadIndicator)
- [Interaction](https://developers.google.com/workspace/chat/api/reference/rest/v1/Action#Interaction)

An action that describes the behavior when the form is submitted. For example, you can invoke an Apps Script script to handle the form. If the action is triggered, the form values are sent to the server.

![](https://www.gstatic.com/images/branding/productlogos/chat_2023q4/v1/192px.svg) ![](https://www.gstatic.com/images/branding/productlogos/gsuite_addons/v6/192px.svg) Available for Google Chat apps and Google Workspace add-ons.

| JSON representation |
|---|
| ``` { "function": string, "parameters": [ { object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/Action#ActionParameter`) } ], "loadIndicator": enum (`https://developers.google.com/workspace/chat/api/reference/rest/v1/Action#LoadIndicator`), "persistValues": boolean, "interaction": enum (`https://developers.google.com/workspace/chat/api/reference/rest/v1/Action#Interaction`), "requiredWidgets": [ string ], "allWidgetsAreRequired": boolean } ``` |

| Fields ||
|---|---|
| `function` | `string` A custom function to invoke when the containing element is clicked or otherwise activated. For example usage, see [Read form data](https://developers.google.com/workspace/chat/read-form-data). |
| `parameters[]` | ``object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/Action#ActionParameter`)`` List of action parameters. |
| `loadIndicator` | ``enum (`https://developers.google.com/workspace/chat/api/reference/rest/v1/Action#LoadIndicator`)`` Specifies the loading indicator that the action displays while making the call to the action. |
| `persistValues` | `boolean` Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. To let the user make changes while the action is being processed, set [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) to `NONE`. For [card messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/create#create) in Chat apps, you must also set the action's [`ResponseType`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#responsetype) to `UPDATE_MESSAGE` and use the same [`cardId`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#CardWithId) from the card that contained the action. If `false`, the form values are cleared when the action is triggered. To prevent the user from making changes while the action is being processed, set [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) to `SPINNER`. |
| `interaction` | ``enum (`https://developers.google.com/workspace/chat/api/reference/rest/v1/Action#Interaction`)`` Optional. Required when opening a [dialog](https://developers.google.com/workspace/chat/dialogs). What to do in response to an interaction with a user, such as a user clicking a button in a card message. If unspecified, the app responds by executing an `action`---like opening a link or running a function---as normal. By specifying an `interaction`, the app can respond in special interactive ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can open a [dialog](https://developers.google.com/workspace/chat/dialogs). When specified, a loading indicator isn't shown. If specified for an add-on, the entire card is stripped and nothing is shown in the client. ![](https://www.gstatic.com/images/branding/productlogos/chat_2023q4/v1/192px.svg) Available for Google Chat apps and unavailable for Google Workspace add-ons. |
| `requiredWidgets[]` | `string` Optional. Fill this list with the names of widgets that this Action needs for a valid submission. If the widgets listed here don't have a value when this Action is invoked, the form submission is aborted. ![](https://www.gstatic.com/images/branding/productlogos/chat_2023q4/v1/192px.svg) ![](https://www.gstatic.com/images/branding/productlogos/gsuite_addons/v6/192px.svg) Available for Google Chat apps and Google Workspace add-ons. |
| `allWidgetsAreRequired` | `boolean` Optional. If this is true, then all widgets are considered required by this action. ![](https://www.gstatic.com/images/branding/productlogos/chat_2023q4/v1/192px.svg) ![](https://www.gstatic.com/images/branding/productlogos/gsuite_addons/v6/192px.svg) Available for Google Chat apps and Google Workspace add-ons. |

## ActionParameter

List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze one day, or snooze next week. You might use `action method = snooze()`, passing the snooze type and snooze time in the list of string parameters.

To learn more, see [`CommonEventObject`](https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#commoneventobject).

![](https://www.gstatic.com/images/branding/productlogos/chat_2023q4/v1/192px.svg) ![](https://www.gstatic.com/images/branding/productlogos/gsuite_addons/v6/192px.svg) Available for Google Chat apps and Google Workspace add-ons.

| JSON representation |
|---|
| ``` { "key": string, "value": string } ``` |

| Fields ||
|---|---|
| `key` | `string` The name of the parameter for the action script. |
| `value` | `string` The value of the parameter. |

## LoadIndicator

Specifies the loading indicator that the action displays while making the call to the action.

![](https://www.gstatic.com/images/branding/productlogos/chat_2023q4/v1/192px.svg) ![](https://www.gstatic.com/images/branding/productlogos/gsuite_addons/v6/192px.svg) Available for Google Chat apps and Google Workspace add-ons.

| Enums ||
|---|---|
| `SPINNER` | Displays a spinner to indicate that content is loading. |
| `NONE` | Nothing is displayed. |

## Interaction

Optional. Required when opening a [dialog](https://developers.google.com/workspace/chat/dialogs).

What to do in response to an interaction with a user, such as a user clicking a button in a card message.

If unspecified, the app responds by executing an `action`---like opening a link or running a function---as normal.

By specifying an `interaction`, the app can respond in special interactive ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can open a [dialog](https://developers.google.com/workspace/chat/dialogs).

When specified, a loading indicator isn't shown. If specified for an add-on, the entire card is stripped and nothing is shown in the client.

![](https://www.gstatic.com/images/branding/productlogos/chat_2023q4/v1/192px.svg) Available for Google Chat apps and unavailable for Google Workspace add-ons.

| Enums ||
|---|---|
| `INTERACTION_UNSPECIFIED` | Default value. The `action` executes as normal. |
| `OPEN_DIALOG` | Opens a [dialog](https://developers.google.com/workspace/chat/dialogs), a windowed, card-based interface that Chat apps use to interact with users. Only supported by Chat apps in response to button-clicks on card messages. If specified for an add-on, the entire card is stripped and nothing is shown in the client. ![](https://www.gstatic.com/images/branding/productlogos/chat_2023q4/v1/192px.svg) Available for Google Chat apps and unavailable for Google Workspace add-ons. |