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 / Powerapps form validation
Power Apps
Unanswered

Powerapps form validation

(0) ShareShare
ReportReport
Posted on by

I have edit form in PowerApp which have text field for phone number and I wanted to validate the Phone Numberentered is only 10 digits,
onChange property I have Set(formattedNumber, Text(Value(DataCardValue1.Text), "[$-en-US](###) ###-####"));

Set(changeNumber, true)


on Default for DataCardValue1 If(IsBlank(Parent.Default), formattedNumber, If(changeNumber, formattedNumber, Text(Parent.Default, "[$-en-US](###) ###-####")))

 

The validation isnt working, i can enter a unlimited amounts of digits which isnt what i want.

What is the best way to handle this use case.

Thanks 

Categories:
  • Jcook Profile Picture
    7,783 Most Valuable Professional on at

    Hello @Powwow1 

     

    You can use the IsMatch function:

    This blog shows multiple validation options, and has one on Phone numbers:

    Phone Number Validation

    1. Not(IsBlank(‘ControlName’)) — It will validate if Field is blank or not.
    2. IsMatch(‘Control’.Text, “Your country Phone Validation ReGex”) — It will validate if the entered phone number is valid or not using ReGex.
    3. I have used phone number validation ReGex for India — “^[6–9]\d{9}$”
    4. Following is an explanation of my ReGex:
    ^ #Match the beginning of the string
    [6-9] #Match a 6, 7, 8 or 9
    \d #Match a digit (0-9 and anything else that is a "digit" in the regex engine)
    {9} #Repeat the previous "\d" 9 times (9 digits)
    $ #Match the end of the string

    5. Code:

    If(
     Not(IsBlank('Phone Number')),
     If(
     IsMatch('Phone Number'.Text, "^[6-9]\d{9}$"),
     "",
     "Please enter Valid Phone No <br>"
     ),
     "Please Enter Phone No. <br>"
    )

    Ref: https://www.cloudfronts.com/form-validation-in-power-apps-part-1/


    https://powerusers.microsoft.com/t5/Building-Power-Apps/Validate-telephone-number/m-p/260727

     

     

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

#2
WarrenBelz Profile Picture

WarrenBelz 194 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 150

Last 30 days Overall leaderboard