microsoft / microsoft/AdaptiveCards
[Bug] [Templating] [dot net] stringOrValue pre-built function throws exception when encountering \"
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2k
- Forks
- 595
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 1
Description
Problem Description
For an adaptive card with the text as
"text": "Title: ${title == \"\"}"
When I do a stringOrValue("Title: ${title == \"\"}") -> The dot net library throws an Invalid expression format exception,
whereas the same text works when tried through the designer (Attached the screenshot below).
Dot net SDK version: 1.2.1
Card JSON
Sample json:
{
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"size": "Medium",
"weight": "Bolder",
"text": "Title: ${title == \"\"}",
"$when": "${title!=\"\"}"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.5"
}
Screenshot
Input in designer:

Output:

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.
Research direction
Start by reproducing the supplied Adaptive Card expression with the .NET SDK version 1.2.1, focusing on the stringOrValue pre-built function. Done means the expression containing an escaped quote no longer throws Invalid expression format and behaves like it does in the designer.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100