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 / Text box validation fo...
Power Apps
Answered

Text box validation for numbers and letters

(0) ShareShare
ReportReport
Posted on by 108

Hello,

 

I'm not sure if this is possible but I'm trying to find a formula to populate an error message on a form when the user does not enter the right information. The information needs to be 3 letters and 3 numbers (ABC123). There are certain letters that should be used but they can be placed in any order. I would prefer that I could specify in the validation those letters but if not then just an error stating they did not enter the correct format would be better than nothing. Thanks for any information you can provide. 

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @bobbybob 

    Put this formula  in the error message for the card containing your textinput box.  Change the name in the formula from TextInput1 to the name of your textinput box and limit the MaxLength property of the textinput box to 6.

     

    If(
     Len(TextInput1.Text) > 0 && !IsMatch(
     Left(
     TextInput1.Text,
     3
     ),
     "[a-zA-Z\s]+"// you can specify your letters here
     ),
     "Values muat start with three letters",
     Len(TextInput1.Text) = 6 && !IsNumeric(
     Right(
     TextInput1.Text,
     3
     )
     ),
     "The final 3 values must be numbers"
    )

     

     

     

     

  • Verified answer
    bobbybob Profile Picture
    108 on at

    Thank you but I ended up figuring it out. I used this formula in the Fill property.

     

    If(Not(IsBlank(DataCardValue9.Text)),If(IsMatch(DataCardValue9.Text, "[E,T,N]{3}\d{3}") && Len(TextFormat.Text),RGBA(0, 0, 0, 0),RGBA(255, 0, 0, 0.5)))

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 379 Most Valuable Professional

#2
11manish Profile Picture

11manish 203 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard