Please guide me to create carousel adaptive card in MS bot framework. I am using .Net sdk.I tried using adaptive card designer to design but couldn't do it.
Media elements are currently not supported in Adaptive Card on the Teams platform.
Adaptive Cards are a platform-agnostic method of sharing and displaying blocks of information without the complexity of customizing CSS or HTML to render them. You author Adaptive Cards in JSON format, with integrations that cloud apps and services can openly exchange.
Your question isn't really specific enough for me to understand where you are having trouble, but I can give you a basic outline of creating a card carousel. My code is nodejs but it should be similar enough to give you an idea.
You will need CardFactory and MessageFactory to generate first the cards and then the Carousel (which takes an array of cards as the input).
// First create an empty array for your carousel
var cardArray = [];
// Populate the array with your cards (can use any method, I used a for loop)
for (var idx = 0; idx < dataForCards.length; idx++) {
// Create the adaptive card
var adaptiveCard = CardFactory.adaptiveCard({
// YOUR CARD DEFINITION HERE
});
// Push the card to the array for the carousel
cardArray.push(adaptiveCard);
}
// Send the array as a carousel
await step.context.sendActivity(MessageFactory.carousel(cardArray));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With