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
Details from original post: Describe the bug
Sometimes Teams would show me an error "Error encountered while rendering this message" without any further detail.
To Reproduce
One of the text fields in my adaptive card is supposed to output the following string (actually, a SQL query):
var sql ="SELECT COUNT(DISTINCT VisitorId) AS UniqueVisitors FROM sitedata WHERE eventdate>='2023-08-01' AND eventdate<'2023-08-08' AND Site =='foo.bar.com' AND Url RLIKE '^http?s://foo.bar.com/([^/]*)/answers/?'"
Steps to reproduce the behavior:
Send the adaptive card and Teams will show that it fails to render the card. There is no exception.
Expected behavior
Card is rendered fine without error.
VS Code Extension Information (please complete the following information):
Teams web or client, both Mac and Windows
Additional context
I tried to figure out what exactly it is that breaks the rendering but the results are non-conclusive.
By trial and error I started removing bits from the SQL string and found that it will still fail with this reduced version of the original string:
"SELECT COUNT(DISTINCT VisitorId) AS UniqueVisitors FROM sitedata WHERE eventdate>='2023-08-01' AND"
However, if I change it further and only remove the last AND, it renders just fine:
"SELECT COUNT(DISTINCT VisitorId) AS UniqueVisitors FROM sitedata WHERE eventdate>='2023-08-01'"
As a workaround I wrapped the assignment into WebUtility.HtmlEncode(sql)and that fixes the issue. This will however break potential formatting such as Markdown.
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
ID: b743e43d-95cc-3d1e-b142-31a16369f97e
Version Independent ID: b743e43d-95cc-3d1e-b142-31a16369f97e
@Krumelur - We are able to repro that issue, we have raised bug for the same. We will inform you once we get any update.
Microsoft Teams Version 1.6.00.24965 (64-bit).
Copied bug from: OfficeDev/teams-toolkit#9826
Details from original post:
Describe the bug
Sometimes Teams would show me an error "Error encountered while rendering this message" without any further detail.
To Reproduce
One of the text fields in my adaptive card is supposed to output the following string (actually, a SQL query):
To render the card I'm using this code:
The card's relevant portion is this:
Steps to reproduce the behavior:
Send the adaptive card and Teams will show that it fails to render the card. There is no exception.
Expected behavior
Card is rendered fine without error.
VS Code Extension Information (please complete the following information):
Teams web or client, both Mac and Windows
Additional context
I tried to figure out what exactly it is that breaks the rendering but the results are non-conclusive.
By trial and error I started removing bits from the SQL string and found that it will still fail with this reduced version of the original string:
"SELECT COUNT(DISTINCT VisitorId) AS UniqueVisitors FROM sitedata WHERE eventdate>='2023-08-01' AND"
However, if I change it further and only remove the last
AND
, it renders just fine:"SELECT COUNT(DISTINCT VisitorId) AS UniqueVisitors FROM sitedata WHERE eventdate>='2023-08-01'"
As a workaround I wrapped the assignment into
WebUtility.HtmlEncode(sql)
and that fixes the issue. This will however break potential formatting such as Markdown.Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: