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 / If TextInput contains ...
Power Apps
Unanswered

If TextInput contains 10 digits, Success, Error

(0) ShareShare
ReportReport
Posted on by 74

HI Everyone, 

 

I am trying to create a data validation formula for phone numbers. I want the Match function to count if there are 10 numbers and if so, no notification, if not, display an error message. I do not want any custom formatting like If(IsMatch( LeftParen & Digit & Digit & Digit &RightParen & Space& Digit & Digit & Digit & Hyphen & Digit & Digit & Digit & Digit), Success,Error).

 

I simply want to ensure people are typing 10 numbers. That's all. I have input masking overlayed so this is why i only need to verify that 10 numbers are inputted.  

 

Any help is much appreciated!

 

Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Masonf2265 

    Consider the following:

    If(CountRows(Filter(Split(yourPhoneNumberValue, ""), IsNumeric(Result)))=10, Success, Error)

     

    So, if you had a label to display if there is not a valid phone number, set the Visible property to:

    !(CountRows(Filter(Split(yourPhoneNumberValue, ""), IsNumeric(Result)))=10)

     

    I hope this is helpful for you.

  • Pstork1 Profile Picture
    69,661 Most Valuable Professional on at

    If you want them to just type the numbers then use the following isMatch

    IsMatch(TextInput2.Text,"[0-9]{10}")

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 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard