Class Card
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
การ์ด
การ์ดบริบทที่แสดงมุมมองเดียวใน UI
const cardSection = CardService.newCardSection();
// Finish building the card section ...
const card = CardService.newCardBuilder()
.setName('Card name')
.setHeader(CardService.newCardHeader().setTitle('Card title'))
.addSection(cardSection)
.build();
เมธอด
วิธีการ | ประเภทการแสดงผล | รายละเอียดแบบย่อ |
printJson() | String | พิมพ์การแสดง JSON ของออบเจ็กต์นี้ |
เอกสารประกอบโดยละเอียด
printJson()
พิมพ์การแสดง JSON ของออบเจ็กต์นี้ การดำเนินการนี้มีไว้สำหรับการแก้ไขข้อบกพร่องเท่านั้น
รีเทิร์น
String
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 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,["# Class Card\n\nCard\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\n### Methods\n\n| Method | Return type | Brief description |\n|-----------------------------|-------------|------------------------------------------------|\n| [printJson()](#printJson()) | `String` | Prints the JSON representation of this object. |\n\nDetailed documentation\n----------------------\n\n### `print``Json()`\n\nPrints the JSON representation of this object. This is for debugging only.\n\n#### Return\n\n\n`String`"]]