web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Adaptive Card Error - ...
Power Automate
Unanswered

Adaptive Card Error - Invalid Input Validation for Text using Regex.

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

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:

ac-06.JPG

 

Example Card as below:

ac-01.JPG

 

Designer's validation properties:

ac-02.JPG

 

Incorrect input (shows error):

ac-03.JPG

 

Correct input (but still shows error):

ac-04.JPG

 

Card JSON:

ac-05.JPG

 

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.

 

Categories:

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 302 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 263

#3
Henil Profile Picture

Henil 115

Last 30 days Overall leaderboard