// An action that opens a linkconstactionResponse=CardService.newActionResponseBuilder().setOpenLink(CardService.newOpenLink().setUrl('https://www.google.com')).build();// An action that shows a notification.constnotificationActionResponse=CardService.newActionResponseBuilder().setNotification(CardService.newNotification().setText('Some info to display to user'),).build();// An action that shows an additional card. It also sets a flag to indicate that// the original state data has changed.constcardBuilder=CardService.newCardBuilder();// Build card ...constnavigationActionResponse=CardService.newActionResponseBuilder().setNavigation(CardService.newNavigation().pushCard(cardBuilder.build())).setStateChanged(true).build();
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-07-26 UTC。"],[[["\u003cp\u003e\u003ccode\u003eActionResponse\u003c/code\u003e enables callback functions to trigger actions like opening links, displaying notifications, and navigating between cards within Google Workspace add-ons.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use \u003ccode\u003eActionResponseBuilder\u003c/code\u003e methods to define these actions and control client-side behavior based on user interactions.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eprintJson()\u003c/code\u003e method helps with debugging by providing the JSON representation of the \u003ccode\u003eActionResponse\u003c/code\u003e object.\u003c/p\u003e\n"]]],["The `ActionResponse` object enables client-side actions from callback functions. It supports actions like opening a link, displaying a notification, or showing a new card. `setOpenLink` opens a specified URL, `setNotification` displays text to the user, and `setNavigation` pushes a new card. `setStateChanged` indicates changes in original data. `printJson()` provides a JSON representation of the object for debugging. Certain action combinations may be unsupported.\n"],null,["ActionResponse\n\nThe response object that may be returned from a callback function (e.g., a form response handler)\nto perform one or more actions on the client. Some combinations of actions are not supported.\n\n```javascript\n// An action that opens a link\nconst actionResponse =\n CardService.newActionResponseBuilder()\n .setOpenLink(CardService.newOpenLink().setUrl('https://www.google.com'))\n .build();\n\n// An action that shows a notification.\nconst notificationActionResponse = CardService.newActionResponseBuilder()\n .setNotification(\n CardService.newNotification().setText(\n 'Some info to display to user'),\n )\n .build();\n\n// An action that shows an additional card. It also sets a flag to indicate that\n// the original state data has changed.\n\nconst cardBuilder = CardService.newCardBuilder();\n// Build card ...\nconst navigationActionResponse = CardService.newActionResponseBuilder()\n .setNavigation(CardService.newNavigation().pushCard(\n cardBuilder.build()))\n .setStateChanged(true)\n .build();\n``` \n\nMethods\n\n| Method | Return type | Brief description |\n|-----------------------------|-------------|------------------------------------------------|\n| [printJson()](#printJson()) | `String` | Prints the JSON representation of this object. |\n\nDetailed documentation \n\n`print``Json()` \nPrints the JSON representation of this object. This is for debugging only.\n\nReturn\n\n\n`String`"]]