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!
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.
If you want them to just type the numbers then use the following isMatch
IsMatch(TextInput2.Text,"[0-9]{10}")
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
199 | |
48 | |
45 | |
45 | |
38 |
User | Count |
---|---|
284 | |
81 | |
80 | |
80 | |
71 |