jsonmarkdownmicrosoft-teamsadaptive-cardsrichtextblock

Adaptive Card: What is the best way to display an arbitrary JSON object?



Any help would be greatly appreciated.


Solution

    1. Embedding JSON inside of a codeblock isn't yet supported, although that would indeed be a great way to solve this use case.
    2. A template isn't necessarily static or fixed. If you're planning to "expand" your template with the AdaptiveCards.Templating NuGet package for instance, you'll have the occasion to load the template into memory. At this time, you can mutate the template according to the incoming JSON at runtime. This isn't an ideal solution, but it is a way to accommodate a truly arbitrary JSON object.
    3. If, on the other hand, if you anticipate that the JSON object will merely be a list of key-value pairs, you can use data binding.