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.
Available for Google Chat apps and Google Workspace add-ons.
| JSON representation |
|---|
{ "function": string, "parameters": [ { object ( |
| Fields | |
|---|---|
function |
A custom function to invoke when the containing element is clicked or otherwise activated. For example usage, see Read form data. |
parameters[] |
List of action parameters. |
loadIndicator |
Specifies the loading indicator that the action displays while making the call to the action. |
persistValues |
Indicates whether form values persist after the action. The default value is If If |
interaction |
Optional. Required when opening a dialog. 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 By specifying an
|
requiredWidgets[] |
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.
|
allWidgetsAreRequired |
Optional. If this is true, then all widgets are considered required by this action.
|
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.
Available for Google Chat apps and Google Workspace add-ons.
| JSON representation |
|---|
{ "key": string, "value": string } |
| Fields | |
|---|---|
key |
The name of the parameter for the action script. |
value |
The value of the parameter. |
LoadIndicator
Specifies the loading indicator that the action displays while making the call to the action.
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.
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.
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.
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, 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.
|