microsoft / microsoft/AdaptiveCards
[Rendering] AEL forEach in when .NET templating does not enumerate an object's properties
Open
@jwoo-msft is already working on this.
Since Aug 8, 2022.
Area-Templating
Bug
- Dominant language
- C#
- Stars
- 2k
- Forks
- 595
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 1
Description
Target Platforms
WPF
SDK Version
1.2.1
Application Name
Hub
Problem Description
forEach does not enumerate the properties of an object when using ,NET templating. The documentation says it should work and the card designer shows it works.
The following card works fine in the card desginer, but not in a .net application:
{
"type": "AdaptiveCard",
"body": [
{
"type": "Container",
"items": [
{
"type": "TextBlock",
"text": "${$data}",
"wrap": true,
"size": "Default",
"spacing": "None"
}
],
"$data": "${foreach(json('{\"test1\":\"object1\",\"test2\":\"object2\",\"test3\":\"object3\"}'),x,x.value)}"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.2"
}
We should see:
object1
object2
object3
But we just get the string of the AEL code.
Screenshots
No response
Card JSON
{
"type": "AdaptiveCard",
"body": [
{
"type": "Container",
"items": [
{
"type": "TextBlock",
"text": "${$data}",
"wrap": true,
"size": "Default",
"spacing": "None"
}
],
"$data": "${foreach(json('{\"test1\":\"object1\",\"test2\":\"object2\",\"test3\":\"object3\"}'),x,x.value)}"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.2"
}
Sample Code Language
No response
Sample Code
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.