Handling Adaptive Cards Version Mismatch Issue

 

Introduction

Adaptive Cards are a way in which Developers can exchange data and content in a common way and the JSON payload used for creating the card can be used in any device or UI Framework. In addition to that, there are no programming requirements for building these cards as the structure is completely defined by JSON(JavaScript Object Notation).In addition to it, we can style the card in a standard way so that it appears consistently across different platforms.

We can use the adaptive card designer to design the JSON for the adaptive card.

Graphical user interface, text, application, email

Description automatically generated

We have covered a few articles on how to work with Adaptive Card JSON to render the cards in Teams below :

Problem Statement

However, while adding the generated JSON to the Power Automate Post adaptive card in chat or channel was throwing the error “We are sorry, this card couldn’t be displayed”

Graphical user interface, application

Description automatically generated

Solution

There can be multiple reasons for this especially if the JSON is not formatted correctly as per syntax. But one of the possible causes, if we are copy-pasting the developed JSON from Adaptive card designer, is that it targets version 1.5 by default. Taking a look at the official documentation, the supported versions in Microsoft Teams are 1.4 for Bot card cards and 1.3 for User sent cards. This holds true as of Jan 2022 and may change in the subsequent months as new updates are rolled out to Teams Platform

Text

Description automatically generated with medium confidence

We can either change the target version in the adaptive card designer while working on the JSON as below:

Graphical user interface, text, application, email

Description automatically generated

Or we can easily change it directly in the JSON schema by updating the version number to 1.4 or less:

Graphical user interface, text, application, email

Description automatically generated

This will fix the issue with the rendering of the adaptive card.

Note: Since we are working on a Bot Sent Card, we have downgraded to v1.4, in case you are working on a User sent card, ensure to downgrade to v1.3. This downgrade holds good as of Jan 2022 and in the future when updates are rolled out to Teams, higher schema versions would be supported.

A picture containing graphical user interface

Description automatically generated

Summary

Thus we saw a potential issue that would cause problems with the rendering of the adaptive cards in Teams due to a mismatch in supporter version number and the ways to solve it.

Related Articles

Author

Author

Priyaranjan KS is a Modern Workplace Architect primarily focused on developing and architecting solutions around Office 365,Power Platform and Azure.He is also a Microsoft Most Valuable Professional(MVP) and a Microsoft Certified Trainer(MCT)

Latest Articles