Zadbaj o dobrą organizację dzięki kolekcji Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Uniwersalnydziałanieodpowiedź
Obiekt odpowiedzi, który może być zwracany przez metodę tworzącą działanie uniwersalne.
// A universal action that opens a link.constopenLinkUniversalAction=CardService.newUniversalActionResponseBuilder().setOpenLink(CardService.newOpenLink().setUrl('https://www.google.com')).build();constcardBuilder1=CardService.newCardBuilder();constcardBuilder2=CardService.newCardBuilder();// Finish building the cards ...// A universal action that shows two static cards.constcardsUniversalAction=CardService.newUniversalActionResponseBuilder().displayAddOnCards([cardBuilder1.build(),cardBuilder2.build()]).build();
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-07-26 UTC."],[[["\u003cp\u003e\u003ccode\u003eUniversalActionResponse\u003c/code\u003e objects are returned from methods creating universal actions, like opening links or displaying cards.\u003c/p\u003e\n"],["\u003cp\u003eThese objects can define actions like opening a web link using \u003ccode\u003esetOpenLink()\u003c/code\u003e or showing cards using \u003ccode\u003edisplayAddOnCards()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eFor debugging, the \u003ccode\u003eprintJson()\u003c/code\u003e method outputs the object's JSON representation as a string.\u003c/p\u003e\n"]]],["The `UniversalActionResponse` object is used to define actions within a card-based interface. Key actions include using the `setOpenLink` method to open a URL and `displayAddOnCards` to display multiple static cards. `printJson()` is a method for debugging, that returns the JSON representation of the object as a string. These methods are used within the `UniversalActionResponseBuilder` to create the object.\n"],null,["UniversalActionResponse\n\nThe response object that may be returned from a method that creates universal action.\n\n```javascript\n// A universal action that opens a link.\nconst openLinkUniversalAction =\n CardService.newUniversalActionResponseBuilder()\n .setOpenLink(CardService.newOpenLink().setUrl('https://www.google.com'))\n .build();\n\nconst cardBuilder1 = CardService.newCardBuilder();\nconst cardBuilder2 = CardService.newCardBuilder();\n// Finish building the cards ...\n\n// A universal action that shows two static cards.\nconst cardsUniversalAction =\n CardService.newUniversalActionResponseBuilder()\n .displayAddOnCards([cardBuilder1.build(), cardBuilder2.build()])\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`"]]