Class DialogAction

  • DialogAction is a builder for DialogAction objects and is only available for Google Chat apps, not Google Workspace add-ons.

  • ThesetActionStatus() method sets the action status of a DialogAction.

  • ThesetDialog() method sets the dialog of a DialogAction.

DialogAction

A builder forDialogAction objects.

Only available for Google Chat apps. Not available for Google Workspace add-ons.

constcard=CardService.newCardBuilder().setHeader(CardService.newCardHeader().setTitle('Card title')).build();constdialog=CardService.newDialog().setBody(card);constdialogAction=CardService.newDialogAction().setDialog(dialog);

Methods

MethodReturn typeBrief description
setActionStatus(actionStatus)DialogActionSets the action status ofDialogAction.
setDialog(dialog)DialogActionSets the dialog of theDialogAction.

Detailed documentation

setActionStatus(actionStatus)

Sets the action status ofDialogAction.

constactionStatus=CardService.newActionStatus().setStatusCode(CardService.Status.OK,);constdialogAction=CardService.newDialogAction().setActionStatus(actionStatus);

Parameters

NameTypeDescription
actionStatusActionStatusTheActionStatus to use.

Return

DialogAction — This object, for chaining.


setDialog(dialog)

Sets the dialog of theDialogAction.

constcard=CardService.newCardBuilder().setHeader(CardService.newCardHeader().setTitle('card title')).build();// Sets the card of the dialog.constdialog=CardService.newDialog().setBody(card);constdialogAction=CardService.newDialogAction().setDialog(dialog);

Parameters

NameTypeDescription
dialogDialogTheDialog to use.

Return

DialogAction — This object, for chaining.

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

Last updated 2025-12-03 UTC.