Hi All,
Please help me fix an issue relating to Adaptive Card's input validation. So basically, I'm using an Adaptive Card for MS Teams which integrates with Power Virtual Agent's Chatbot for development. I'm using the version 1.3 because that's the only version is supported by MS Teams specifically for the validation feature now. And the higher versions of it won't work with Teams.
So, I have worked out the Card's validation for Text field by adding Regex pattern on it. However, the issue that I’m facing now is that the regex (validation) cannot validate the user input correctly as it keeps showing error message underneath whether the user gives the correct or wrong input . I have tried many ways of changing regex pattern and I have also checked and tested it on Regex Tester, and it passed. But somehow it won’t work validating correctly as it’s supposed to.
I’m wondering does the error have to do with the Adaptive Card’s version (1.3) as opposed to other versions.
Automate:
Example Card as below:
Designer's validation properties:
Incorrect input (shows error):
Correct input (but still shows error):
Card JSON:
Code:
{
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"size": "ExtraLarge",
"weight": "Bolder",
"text": "Order Detail",
"fontType": "Monospace",
"color": "Dark",
"horizontalAlignment": "Center",
"spacing": "Medium"
},
{
"type": "Input.Text",
"placeholder": "please insert the order number here...",
"id": "userInput",
"separator": true,
"label": "Order Number:",
"maxLength": 255,
"regex": "^[0-9]{3}-[0-9]{4}$",
"errorMessage": "Invalid number. Use format: 000-1111"
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "stretch"
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "ActionSet",
"actions": [
{
"type": "Action.Submit",
"title": "SEND",
"id": "1"
}
],
"horizontalAlignment": "Right",
"separator": true,
"spacing": "Medium"
}
]
}
]
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.3"
}
I'm really not sure what went wrong and what have I missed here. Please help me how to fix this issue.

Report
All responses (
Answers (