Forum Discussion

Hiral_Patel's avatar
Hiral_Patel
Copper Contributor
Jun 30, 2021
Solved

Teams messaging extension not allowing to send multiple adaptive cards.

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

  • MHong2012's avatar
    MHong2012
    Copper Contributor
    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.
      • Nivedipa-MSFT's avatar
        Nivedipa-MSFT
        Icon for Microsoft rankMicrosoft

        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.

  • 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?

     

    • Hiral_Patel's avatar
      Hiral_Patel
      Copper Contributor
      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.

Resources