Search code examples
botframeworkmicrosoft-teamsadaptive-cards

Cannot display more than 6 adaptive actions in an Adaptive card in Teams


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?


Solution

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