SOLVED

Teams messaging extension not allowing to send multiple adaptive cards.

Copper Contributor

I have created one teams messaging extension, and trying to pass array of adaptive card attachments on response to an action based command show multiple cards but its just picking up first card and ignored the rest of the cards.

 

let card = {
    type: "AdaptiveCard",
    version: "1.0",
    body: [{ type: "TextBlock"text: "Hiral" }],
  };
  const adaptiveCard = CardFactory.adaptiveCard(card);

  const attachment1 = {
    contentType: adaptiveCard.contentType,
    content: adaptiveCard.content,
    preview: adaptiveCard,
  };
  return {
    composeExtension: {
      type: "result",
      attachmentLayout: "list",
      attachments: [attachment1attachment2attachment3],
    },
  };
 
In above code whatever attachment I add first in array it shows that card only and ignores rest of the cards.
8 Replies
best response confirmed by Hiral_Patel (Copper Contributor)
Solution

@Hiral_Patel - Response to action based command supports only one card. Could you please confirm what you are trying to achieve? Are you looking to provide search responses something similar to this?

WajeedMSFT_0-1625079257635.png

 

I just wanted to send 2 adaptive cards for action based command as a response.
Its showing first card from attachments array and ignored the other one.
We are facing the same issue - can't send multiple attachments (cards) in one response. We have a task module to allow users to select multiple files, then create a card for each select file.
We will investigate on it from our end and get back to you.

@Hiral_Patel, @MHong2012 - We are able to repro this issue and we have raised a bug for it.
We will let you know once we get updates on it.

Thank you Nivedipa and ChetanSharma.
@Hiral_Patel, @MHong2012 - Engineering team has confirmed that this behaviour is by design.

@Nivedipa-MSFT 

 

{
    "composeExtension": {
        "attachmentLayout": "list",
        "type": "result",
        "attachments": [
            {
                "contentType": "application/vnd.microsoft.card.thumbnail",
                "content": {
                    "title": "1.5 Contoso (1)",
                    "subtitle": "12-05-2022 | Demo User Admin",
                    "images": [
                        {
                            "url": "https://services.klobot.ai/apps/live/netdocshare/assets/images/folderIcons/teams32x32/icon-Power.png",
                            "alt": "Icon"
                        }
                    ],
                    "buttons": [
                        {
                            "type": "openUrl",
                            "title": "View",
                            "value": "https://klobotappsdev.azurewebsites.net/apps/netdocshareservice//api/v1.0/imconnector/teams/Mjk6MXd4b1ZSTkF0b1hjYjR2MTl6ZDhVUDZHUjZUZUNtSVJGbm9VVFVQcll1cVc4NE5ESktrb3VPUlhCeGtheDVtWWdGc1hDSXpXYnVRZUdwLWRlVHp2Z3Vn/view"
                        },
                        {
                            "type": "openUrl",
                            "title": "Download",
                            "value": "https://klobotappsdev.azurewebsites.net/apps/netdocshareservice//api/v1.0/imconnector/teams/Mjk6MXd4b1ZSTkF0b1hjYjR2MTl6ZDhVUDZHUjZUZUNtSVJGbm9VVFVQcll1cVc4NE5ESktrb3VPUlhCeGtheDVtWWdGc1hDSXpXYnVRZUdwLWRlVHp2Z3Vn/download"
                        },
                        {
                            "type": "openUrl",
                            "title": "Check out",
                            "value": "https://klobotappsdev.azurewebsites.net/apps/netdocshareservice//api/v1.0/imconnector/teams/Mjk6MXd4b1ZSTkF0b1hjYjR2MTl6ZDhVUDZHUjZUZUNtSVJGbm9VVFVQcll1cVc4NE5ESktrb3VPUlhCeGtheDVtWWdGc1hDSXpXYnVRZUdwLWRlVHp2Z3Vn/checkout"
                        }
                    ]
                }
            },
            {
                "contentType": "application/vnd.microsoft.card.thumbnail",
                "content": {
                    "title": "MS_test_1",
                    "subtitle": "12-12-2022 | Demo User Admin",
                    "images": [
                        {
                            "url": "https://services.klobot.ai/apps/live/netdocshare/assets/images/folderIcons/teams32x32/icon-Word.png",
                            "alt": "Icon"
                        }
                    ],
                    "buttons": [
                        {
                            "type": "openUrl",
                            "title": "View",
                            "value": "https://klobotappsdev.azurewebsites.net/apps/netdocshareservice//api/v1.0/imconnector/teams/Mjk6MXd4b1ZSTkF0b1hjYjR2MTl6ZDhVUDZHUjZUZUNtSVJGbm9VVFVQcll1cVc4NE5ESktrb3VPUlhCeGtheDVtWWdGc1hDSXpXYnVRZUdwLWRlVHp2Z3Vn/view"
                        },
                        {
                            "type": "openUrl",
                            "title": "Download",
                            "value": "https://klobotappsdev.azurewebsites.net/apps/netdocshareservice//api/v1.0/imconnector/teams/Mjk6MXd4b1ZSTkF0b1hjYjR2MTl6ZDhVUDZHUjZUZUNtSVJGbm9VVFVQcll1cVc4NE5ESktrb3VPUlhCeGtheDVtWWdGc1hDSXpXYnVRZUdwLWRlVHp2Z3Vn/download"
                        },
                        {
                            "type": "openUrl",
                            "title": "Check out",
                            "value": "https://klobotappsdev.azurewebsites.net/apps/netdocshareservice//api/v1.0/imconnector/teams/Mjk6MXd4b1ZSTkF0b1hjYjR2MTl6ZDhVUDZHUjZUZUNtSVJGbm9VVFVQcll1cVc4NE5ESktrb3VPUlhCeGtheDVtWWdGc1hDSXpXYnVRZUdwLWRlVHp2Z3Vn/checkout"
                        }
                    ]
                }
            }
        ]
    }
}

Hi the above response is for Action type with Dynamic input, we are loading a form collect information and sending back the list of cards. But the result takes only the first and shows. Still is it a correct behavior?

 

 

1 best response

Accepted Solutions
best response confirmed by Hiral_Patel (Copper Contributor)
Solution

@Hiral_Patel - Response to action based command supports only one card. Could you please confirm what you are trying to achieve? Are you looking to provide search responses something similar to this?

WajeedMSFT_0-1625079257635.png

 

View solution in original post