Search code examples
botframeworkmicrosoft-teams

Bot Framework & MS Teams - Why are the buttons not visible for the query-type messaging extension?


As per the documentation of messaging extension here, we can either use a hero card or thumbnail card as a preview of messaging extension. Both cards support the buttons. When buttons are implemented in either of these cards, they are not appearing on the search result of messaging extension. Any workaround regarding the same?


Solution

  • In the preview card, buttons and tap actions are not supported. You can refer to the same doc: Response card types and previews

    The Hero or Thumbnail card button and tap actions, except invoke, are not supported in the preview card.

    Buttons can be shown when user select or click on item from the list. You can refer this sample -> TeamsMessagingExtensionsSearchBot.cs -> GetAdaptiveCard()

    Here are screenshots, how it will look:

    1. Search results:

      Messaging extension screenshot.

    2. When you select, it will render this way- Rendered Adaptive card screenshot You can see Adaptive card button here same and can be done with others.