I think the functionality is there, but you will have to play with it to make it work. I would add each collapsible section as a new section.
Using the above tool and just playing around, I created 2 sections, adding a paragraph to the first and an image to the second, and set them both to collapsible
Once you build your card, you can copy the output on the bottom right side. (Note: I don't think the upper right JSON output is supported yet).
Here is the output from the above example:
function buildHomeCard(opts) {
var builder = CardService.newCardBuilder();
builder.addSection(CardService.newCardSection()
.setHeader('Home')
.setCollapsible(true) .setNumUncollapsibleWidgets(
0)
.addWidget(CardService.newTextParagraph()
.setText(
'This is a <b>paragraph</b>. It can <a href="
https://google.com">link</a>, force new</br>lines, use <i>italics</i>, etc...</i>'
)));
builder.addSection(CardService.newCardSection()
.setHeader('ixQ Insights')
.setCollapsible(true) .setNumUncollapsibleWidgets(
0)
.addWidget(CardService.newImage()
.setImageUrl(
'
https://source.unsplash.com/collection/190727/1600x900')
.setAltText('Placeholder image')));
return builder.build();
}
Again, mine isn't perfectly what you want, so you will have to play around with it.