diff --git a/apps-script/3p-resources/3p-resources.gs b/apps-script/3p-resources/3p-resources.gs index ea2d159..b6e5c87 100644 --- a/apps-script/3p-resources/3p-resources.gs +++ b/apps-script/3p-resources/3p-resources.gs @@ -35,13 +35,15 @@ function caseLinkPreview(event) { .setTitle(`Case ${caseDetails["name"][0]}`); const caseDescription = CardService.newTextParagraph() .setText(caseDetails["description"][0]); - - // Returns the card. - // Uses the text from the card's header for the title of the smart chip. - return CardService.newCardBuilder() + const card = CardService.newCardBuilder() .setHeader(caseHeader) .addSection(CardService.newCardSection().addWidget(caseDescription)) .build(); + + // Returns the link preview smart chip with its dedicated title. + return CardService.newLinkPreview() + .setTitle(`Case ${caseDetails["name"][0]} - caseDetails["description"][0]`) + .setPreviewCard(card); } } @@ -268,4 +270,4 @@ function createLinkRenderAction(title, url) { } // [END add_ons_3p_resources_link_render_action] -// [END add_ons_3p_resources] \ No newline at end of file +// [END add_ons_3p_resources]