3
votes

I am new to bot framework and c# - we implemented a bot using a QnA maker knowledge base. I am trying to use adaptive cards with Adaptive Submit Actions.

Everything works perfectly in the WebChat, however in Teams I cannot display more than 6 submit actions at the same time...

Please find a test code below:

        var demoActionList = new List<AdaptiveAction>();

        for (int i=0; i<20; i++)
        {
            demoActionList.Add(
                   new AdaptiveSubmitAction()
                   {
                       Type = "Action.Submit",
                       Title = "title + "+i,
                       Data = new QnABot.Dialog.MsTeamsDataResponseWrapper() { MsTeamsResponse = new QnABot.Dialog.MsTeamsResponse() { Value = "title + " + i } }
                   });
        }

        var plCard = new AdaptiveCard(new AdaptiveSchemaVersion(1, 0));

        plCard.Actions = demoActionList;

        var attachment = new Attachment()
        {
            ContentType = AdaptiveCard.ContentType,
            Content = plCard
        };

        chatActivity.Attachments.Add(attachment);

If I run this code in the webchat I will see all the 20 submit actions in the adaptive cards, however in ms teams I see only 6

Please see the example with teamsexample with teams, and the example with the webchat example with the webchat

Any idea how to display all the submit actions in the card with ms teams?

2
You can try hero card through which you can show what you have shown on screen shot. As its recommended by Microsoft to use max 10 attachment on adaptive card each time. Le me know if you need code implementation I could help with.Md Farid Uddin Kiron
Thanks for your reply - unfortunately I was using hero cards before, which is great to display all actions, but does not support the markdown format in msteams... and the QnA maker knowledge base that I am using is formatting message with Markdown Format.... I had created this question initally and had been advised to use AdaptiveCards instead. do you know if I could use HeroCards and markdown format in teams?, it did not work but maybe there is a way to work around?Valentin Mazhar
I was also like to use adaptive card but due to rush and few complexity I had postponed develop with that, anyway, I would try to answer your question with adaptive card example. Good dayMd Farid Uddin Kiron

2 Answers

3
votes

Teams does support carousels, so you could have multiple card attachments in a single activity like this.

0
votes

This is a known hard limit in Teams right now - see this answer from someone at Microsoft not long ago: Can I show more than one button/option in teams using cards? which includes some suggested workarounds.

update: I'm also wondering if list cards might be of interest - it would look a bit similar to the web chat example you showed above - basically a long list of options.