Stay organized with collections
Save and categorize content based on your preferences.
Card
A context card that represents a single view in the
UI.
constcardSection=CardService.newCardSection();// Finish building the card section ...constcard=CardService.newCardBuilder().setName('Card name').setHeader(CardService.newCardHeader().setTitle('Card title')).addSection(cardSection).build();
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-12-02 UTC."],[[["\u003cp\u003eCards provide single views in the UI and are built using sections.\u003c/p\u003e\n"],["\u003cp\u003eCards can have names, headers, and sections added.\u003c/p\u003e\n"],["\u003cp\u003eA \u003ccode\u003eprintJson()\u003c/code\u003e method is available for debugging the card's JSON representation.\u003c/p\u003e\n"]]],["A `Card` is a UI element representing a single view, built using `CardService`. The process involves creating a `CardSection`, then a `Card` builder. The builder sets the `Card`'s name, header, and adds the `CardSection`. Finally, the `Card` is built. The `printJson()` method returns a JSON string representation of the `Card` for debugging. This method is intended for debugging purposes only.\n"],null,["Card\n\nA context [card](/gmail/add-ons/concepts/cards) that represents a single view in the\nUI.\n\n```javascript\nconst cardSection = CardService.newCardSection();\n// Finish building the card section ...\n\nconst card = CardService.newCardBuilder()\n .setName('Card name')\n .setHeader(CardService.newCardHeader().setTitle('Card title'))\n .addSection(cardSection)\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`"]]