You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an issue where properties in the JavaScript version of the AdaptiveCards Templating SDK are undefined.
How can I resolve this issue?issue-adaptive-cards-sdk.docx
Screenshots
Card JSON
// Define the Adaptive Card templateconst cardTemplate = {"type":"AdaptiveCard","version":"1.0","body":[
{"type":"TextBlock","text":"Hello ${name}!"},
{"type":"TextBlock","text":"=if(age >= 18, 'You are an adult.', 'You are a minor.')"}]};// Define dynamic data (this could come from an API or user input)const dynamicData = {"$root":{"name":"John","age":25}};
Sample Code Language
JS
Sample Code
<title>Adaptive Card with Expressions</title>
Adaptive Card with Dynamic Expression
<script src="https://unpkg.com/[email protected]/dist/adaptivecards.min.js"></script>
<script src="https://unpkg.com/adaptivecards-templating/dist/adaptivecards-templating.min.js"></script>
<script>
// Define the Adaptive Card template
const cardTemplate = {"type":"AdaptiveCard","version":"1.0",
"body":[
{"type":"TextBlock","text":"Hello ${name}!"},
{"type":"TextBlock","text":"=if(age >= 18, 'You are an adult.', 'You are a minor.')"}]};
// Define dynamic data (this could come from an API or user input)
const dynamicData = {"$root":{"name":"John","age":25}};
// Use adaptive-expressions to evaluate expressions in the template
const template = new AdaptiveCards.AdaptiveCard();
const card = new ACData.Template(cardTemplate);
// Expand the template with the dynamic data
const cardPayload = card.expand({ $root: dynamicData });
// Parse and render the adaptive card
template.parse(cardPayload);
document.getElementById("adaptiveCardDiv").appendChild(template.render());
</script>
The text was updated successfully, but these errors were encountered:
@xiaolufei - Thanks for the confirmation. We were able to reproduce the issue.
We have logged this as a bug, and our engineering team will look into it.
While we cannot guarantee a fix at this stage, we will keep you updated with any progress or changes. Please note that in some cases, the bug may be by design or deprioritized due to platform updates, but we will continue to monitor the bug closely.
@Nivedipa-MSFT I hope you can resolve this issue as soon as possible. Currently, this problem is blocking our work and causing our card data to fail to render.
Target Platforms
Other
SDK Version
2.3.1
Application Name
adaptivecards-templating
Problem Description
I encountered an issue where properties in the JavaScript version of the AdaptiveCards Templating SDK are undefined.
How can I resolve this issue?issue-adaptive-cards-sdk.docx
Screenshots
Card JSON
Sample Code Language
JS
Sample Code
<title>Adaptive Card with Expressions</title>Adaptive Card with Dynamic Expression
<script src="https://unpkg.com/[email protected]/dist/adaptivecards.min.js"></script> <script src="https://unpkg.com/adaptivecards-templating/dist/adaptivecards-templating.min.js"></script> <script> // Define the Adaptive Card template const cardTemplate = {"type":"AdaptiveCard","version":"1.0", "body":[ {"type":"TextBlock","text":"Hello ${name}!"}, {"type":"TextBlock","text":"=if(age >= 18, 'You are an adult.', 'You are a minor.')"}]}; // Define dynamic data (this could come from an API or user input) const dynamicData = {"$root":{"name":"John","age":25}};The text was updated successfully, but these errors were encountered: