با مجموعهها، منظم بمانید ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
پیش نمایش لینک
عملکرد کارت که کارت پیشنمایش پیوند و تراشه هوشمند را در برنامه میزبان نمایش میدهد. برای اطلاعات بیشتر، به پیش نمایش پیوندها با تراشه های هوشمند مراجعه کنید.
عنوانی که در تراشه هوشمند نمایش داده می شود را برای پیش نمایش پیوند تنظیم می کند.
مستندات دقیق
print Json()
نمایش JSON این شی را چاپ می کند. این فقط برای رفع اشکال است.
بازگشت
String
set Link Preview Title(title)
عنوانی را که در پیشنمایش پیوند بالای کارت پیشنمایش نمایش داده میشود، تنظیم میکند. اگر تنظیم نشود، پیشنمایش پیوند سرصفحه Preview Card را نمایش میدهد.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","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-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003e\u003ccode\u003eLinkPreview\u003c/code\u003e is a card action that displays a preview card and smart chip within a host application.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can customize the title shown in the link preview and smart chip using \u003ccode\u003esetLinkPreviewTitle()\u003c/code\u003e and \u003ccode\u003esetTitle()\u003c/code\u003e, respectively.\u003c/p\u003e\n"],["\u003cp\u003eA preview card, created using \u003ccode\u003eCardService\u003c/code\u003e, provides detailed information about the linked content within the \u003ccode\u003eLinkPreview\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003esetPreviewCard()\u003c/code\u003e is used to attach this custom preview card to the \u003ccode\u003eLinkPreview\u003c/code\u003e action.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eprintJson()\u003c/code\u003e method is available for debugging purposes to inspect the JSON representation of the \u003ccode\u003eLinkPreview\u003c/code\u003e object.\u003c/p\u003e\n"]]],[],null,["LinkPreview\n\nCard action that displays a link preview card and smart chip in the host app. For more\ninformation, refer to [Preview links\nwith smart chips](https://developers.google.com/apps-script/add-ons/editors/gsao/preview-links).\n\n```javascript\nconst decoratedText =\n CardService.newDecoratedText().setTopLabel('Hello').setText('Hi!');\n\nconst cardSection = CardService.newCardSection().addWidget(decoratedText);\n\nconst card = CardService.newCardBuilder().addSection(cardSection).build();\n\nconst linkPreview = CardService.newLinkPreview().setPreviewCard(card).setTitle(\n 'Smart chip title');\n``` \n\nMethods\n\n| Method | Return type | Brief description |\n|------------------------------------------------------------|------------------|------------------------------------------------------------------------------------------------|\n| [printJson()](#printJson()) | `String` | Prints the JSON representation of this object. |\n| [setLinkPreviewTitle(title)](#setLinkPreviewTitle(String)) | [LinkPreview](#) | Sets the title that displays in the link preview above the preview card. |\n| [setPreviewCard(previewCard)](#setPreviewCard(Card)) | [LinkPreview](#) | Sets the card that displays information about a link from a third-party or non-Google service. |\n| [setTitle(title)](#setTitle(String)) | [LinkPreview](#) | Sets the title that displays in the smart chip for the link preview. |\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`\n\n*** ** * ** ***\n\n`set``Link``Preview``Title(title)` \nSets the title that displays in the link preview above the preview card. If unset, the link\npreview displays the header of the `Preview``Card`.\n\n```javascript\nconst linkPreview =\n CardService.newLinkPreview().setLinkPreviewTitle('Link preview title');\n```\n\nParameters\n\n| Name | Type | Description |\n|---------|----------|--------------------------------|\n| `title` | `String` | The title of the link preview. |\n\nReturn\n\n\n[LinkPreview](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n`set``Preview``Card(previewCard)` \nSets the card that displays information about a link from a third-party or non-Google service.\n\n```javascript\nconst decoratedText =\n CardService.newDecoratedText().setTopLabel('Hello').setText('Hi!');\n\nconst cardSection = CardService.newCardSection().addWidget(decoratedText);\n\nconst card = CardService.newCardBuilder().addSection(cardSection).build();\n\nconst linkPreview = CardService.newLinkPreview().setPreviewCard(card).setTitle(\n 'Smart chip title');\n```\n\nParameters\n\n| Name | Type | Description |\n|-----------------|--------------------------------------------------|-------------------|\n| `preview``Card` | [Card](/apps-script/reference/card-service/card) | The preview card. |\n\nReturn\n\n\n[LinkPreview](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n`set``Title(title)` \nSets the title that displays in the smart chip for the link preview. If unset, the smart chip\ndisplays the header of the `Preview``Card`.\n\n```javascript\nconst linkPreview = CardService.newLinkPreview().setTitle('Smart chip title');\n```\n\nParameters\n\n| Name | Type | Description |\n|---------|----------|------------------------------|\n| `title` | `String` | The title of the smart chip. |\n\nReturn\n\n\n[LinkPreview](#) --- This object, for chaining."]]