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 Apps / Validation Issue on en...
Power Apps
Answered

Validation Issue on entered text where to put to prevent saving if text is colored Red save if color = Green

(0) ShareShare
ReportReport
Posted on by 516

I can not seem to get the validation on the OnSave to allow me to save the form.  How do I fix this?

If(DataCardValue13.Text="([a-zA-Z])([-])([0-9])([0-9])([0-9])([0-9])([0-9])([-])([0-9])([0-9]))",SubmitForm(SharePointForm1),
Notify("Item Number Is Entered Wrong Please Correct In Order To Save Form",NotificationType.Error), false;
)

Categories:
  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @SPS-DEV-22 ,

     

    Please try and use IsMatch along with following RegEx:

    IsMatch(DataCardValue1.Text,"^[a-zA-Z][-][\d]{5}[-][\d]{2}$")

     

    If statement:

    If(
     IsMatch(
     DataCardValue1.Text,
     "^[a-zA-Z][-][\d]{5}[-][\d]{2}$"
     ),
     SubmitForm(SharePointForm1),
     Notify(
     "Item Number Is Entered Wrong Please Correct In Order To Save Form",
     NotificationType.Error
     )
    )

     

    Best regards,

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 Apps

#1
11manish Profile Picture

11manish 232 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 202 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard