ContosoScubaBot icon indicating copy to clipboard operation
ContosoScubaBot copied to clipboard

Dynamically binding data to a card

Open thecouchcoder opened this issue 6 years ago • 4 comments

How would you go about dynamically binding data to an adaptive card?

For example, in Schools.JSON you can assume this query would actually go look up schools on Google then dynamically build the card. Is there a way to do this without hacking together the card through code? Any data binding options?

thecouchcoder avatar Jun 18 '18 18:06 thecouchcoder

The https://www.nuget.org/packages/Razorback/ library provides this type of binding using Razor syntax. ProxyMessageView.cshtml and WildlifeView.cshtml in this project are using Razorback: https://github.com/matthidinger/ContosoScubaBot/tree/master/CardViews

EricDahlvang avatar Jun 18 '18 18:06 EricDahlvang

Do you know of something similar to Razorback for node projects?

thecouchcoder avatar Jun 18 '18 18:06 thecouchcoder

Sure do! 🙂

https://github.com/justinwilaby/babel-plugin-jsx-adaptive-cards

matthidinger avatar Jun 18 '18 19:06 matthidinger

Thank you! I really appreciate the guidance!

thecouchcoder avatar Jun 18 '18 19:06 thecouchcoder