-
Notifications
You must be signed in to change notification settings - Fork 486
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
Template expand issues with string() and jsonStringify() #6186
Comments
This looks like a known issue with Adaptive Card templating and Adaptive Expressions (both of which use Please see this issue for further info: @boydc2014 I'm going to assign this one to you as well. Feel free to close whichever is more appropriate and leave the other for tracking the issue. |
Thanks @dmvtech, i'm routing this to Monica as owner. |
@dmvtech investigate further - understand if there is an appropriate escape sequence |
Since it appears that Adaptive Card templating is not currently implemented within the SDK, you are likely going to have to handle this in a specific manner. i.e. it may have to escape characters at certain points, etc. I believe you will have to do the adaptive expressions evaluation before passing it to the adaptive card template If you can share your json card template, that will give more for us to go on and give any suggestions, etc. |
Data
1. Hardcoded with "Template
Expanded template (didn't expand)
2. Hardcoded with 'Template
Expanded template (didn't expand)
3. Referenced as objectTemplate
Expanded template
Notice that this time referenced object (person) was expanded, but "text":"{"name":"Sophie Owen"}" part is not a valid JSON because of quotes |
Thank you @i-knezevic-milan
Can you confirm the method you're using ExpandTemplate() (there is no If you are intending the value of # AnAdaptiveCard
- ```{
{
"type":"AdaptiveCard",
"$schema":"http://adaptivecards.io/schemas/adaptive-card.json",
"version":"1.4",
"id":"adaptiveCard1",
"title":"Server side object string",
"body":[
{
"type":"TextBlock",
"id":"textBlock1",
"text":${string({"name": "Sophie Owen"})}
}
]
}
}``` Using the above in _templates = Templates.ParseFile(@"C:\testing.lg");
var expandedlg = _templates.ExpandTemplate("AnAdaptiveCard"); I get the following: {
{
"type":"AdaptiveCard",
"$schema":"http://adaptivecards.io/schemas/adaptive-card.json",
"version":"1.4",
"id":"adaptiveCard1",
"title":"Server side object string",
"body":[
{
"type":"TextBlock",
"id":"textBlock1",
"text":{"name":"Sophie Owen"}
}
]
}
}
If that's not what you are looking for, my apologies. Please give me further info and more specific steps on what you are doing and what the output should be. |
Closing due to inactivity. If you still need assistance, please comment or reopen and we can continue to work on this. |
Version
.NET SDK 6
AdaptiveCards.Templating 1.2.2
Describe the bug
e.g.
Same errors can be seen when using jsonStringify
The text was updated successfully, but these errors were encountered: