تنظيم صفحاتك في مجموعات يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
الإجراءالاستجابة
عنصر الاستجابة الذي يمكن إرجاعه من دالة ردّ اتصال (مثل معالِج استجابة النموذج) لتنفيذ إجراء واحد أو أكثر على العميل بعض مجموعات الإجراءات غير متاحة.
// 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();
تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\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`"]]