Closed enzanki-ars closed 3 years ago
please review this issue for target Milestone, Inconsistencies & Priority upon triage.
Additional note:
In the original sample, the following block was included, but adding specifically the "color": "${if(change >= 0, 'good', 'attention')}"
line results in MS Teams returning a 400 error. Because the platform does not return any message, I have no idea where the problem lies and why this is the case, but the web editor also seems to display the same issue there too.
{
"type": "TextBlock",
"text": "${if(change >= 0, '▲', '▼')} ${formatNumber(change,2)} USD (${formatNumber(changePercent * 100, 2)}%)",
"color": "${if(change >= 0, 'good', 'attention')}",
"spacing": "None"
}
@enzanki-ars , Templating do works in adaptive card but when I checked this in power shell it is not working may be it is a Bug with powershell
Hi folks, templating is not currently available directly within Teams so you would have to bind the template and data in PowerShell before sending it to Teams. I'm not entirely familiar with PowerShell but if you can consume .NET packages you should be able to use this SDK and API to handle the binding:
https://docs.microsoft.com/en-us/adaptive-cards/templating/sdk#net
Sorry about the confusion, please re-open if anything is unclear or if you need further assistance. We are still too far out from having a reliable timeline for when templating will be available in Teams
Platform
What platform is your issue or question related to? (Delete other platforms).
Author or host
Author
Version of SDK
None.
Details
When attempting to send a templated card as shown below, copied from the Adaptive Card Samples, none of the templated vaules are replaced:
The code above results in: