Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Preview does not render array bound elements #10

Open
garrytrinder opened this issue Aug 12, 2022 · 1 comment
Open

[BUG]: Preview does not render array bound elements #10

garrytrinder opened this issue Aug 12, 2022 · 1 comment

Comments

@garrytrinder
Copy link
Contributor

We can use the $data property to repeat elements using an array of data, this is documented in the below Microsoft Docs page under the section Repeating items in an array.

https://docs.microsoft.com/en-us/adaptive-cards/templating/language#repeating-items-in-an-array

Given the following template and sample test data, a FactSet is used to render the displayName and userPrincipalName which has an array of User objects bound to the $data property of the FactSet object.

The preview does not render the list or values.

image

It is however correctly rendered in the AdaptiveCards.io designer when the Preview Mode is enabled.

image

I am suggesting that this is a bug due to the answer from @DeeJayTC on the below StackOverflow post which suggests that rendering of array bound elements is possible.

If you need a design time experience for array bound elements you can use Adaptive Cards Studio the Visual Studio Code Extension for card authoring.

https://stackoverflow.com/a/63233919/4871999


Template

{
  "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
  "type": "AdaptiveCard",
  "version": "1.4",
  "body": [
    {
      "type": "FactSet",
      "facts": [
        {
          "$data": "${users}",
          "title": "${displayName}:",
          "value": "${userPrincipalName}"
        }
      ]
    }
  ]
}

Data

{
    "users": [
        {
            "displayName": "Lidia Holloway",
            "userPrincipalName": "[email protected]"
        },
        {
            "displayName": "MOD Administrator",
            "userPrincipalName": "[email protected]"     
        },
        {
            "displayName": "Isaiah Langer",
            "userPrincipalName": "[email protected]"
        }
    ]
}
@DeeJayTC
Copy link
Contributor

Thanks! Gotta check again if i can fix that...been a while since i posted that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants