web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Validate phone number/...
Power Apps
Unanswered

Validate phone number/email

(2) ShareShare
ReportReport
Posted on by 35

I could not find exactly what I was looking for in previous posts, so I decided to create a new one.

 

Is there a way to make sure the text field for users to input their email contains the "@" sign? Or that the phone number field has at least ten characters?

 

Any help would be much appreciated!

Categories:
I have the same question (0)
  • Verified answer
    CarlosFigueira Profile Picture
    on at

    You can use the IsMatch function, which should do what you need. For example, if you want to highlight a text input that should contain an e-mail, you can use the following expression in its BorderColor property.

    If(IsMatch(TextInput1.Text, Match.Email), Color.Blue, Color.Red)

    The function IsMatch can be used for a lot of scenarios, but for simpler cases, like in your second example (minimum length), you can use the Len function, which returns the number of characters in a string. In an example similar to the one above, you could set the border color of the text input that is used to enter the telephone number to the expression below:

    If(Len(TextInput2.Text) < 10, Color.Red, Color.Blue)

     

  • er Profile Picture
    35 on at

    That worked perfectly, thank you! 

     

    Is there a way that I can add this to the "OnChange" so that it doesn't come up red until they insert something incorrectly?

  • UNILIEN Profile Picture
    4 on at

    Hello,

     

    I tried it on my form and it doesn't work

     

    If(IsMatch(DataCardValue12.Text;Match.Email);Color.Blue;Color.Red)

     

    Can you help me ?

     

    Helene

     

  • Community Power Platform Member Profile Picture
    on at

    This answer is working well. but could not stop form to get submit and update data back to data source. My email input box isinside datacard? any help would be highly apprecieted.

  • timl Profile Picture
    36,383 Super User 2025 Season 2 on at

    @Anonymous

     

    To validate your data on form submission, change the formula for your submit button from SubmitForm(EditForm1) to:

     

    If(IsMatch(TextInput1.Text, Match.Email), SubmitForm(EditForm1))

     

  • Lana Profile Picture
    90 on at

     

    If(Len(TextInput2.Text) < 10, Color.Red, Color.Blue)

     This formula can't be used for phone number as it checks the length of the string doesn't matter if its a number or a letter.

     

    If they type "TELEVISION" in the phone number textbox it will still validated it right?

  • Community Power Platform Member Profile Picture
    on at

    You might be able to use a combination of the len and IsNumeric functions to make sure it's a number and that it's at least 10 numbers long. I haven't tested it though so can't say for sure 🙂

  • Nena Profile Picture
    25 on at

    Hi

    power apps is not taking datacard.Text says is invalid, probably this is an old version, but is not working for me.

     

  • iAm_ManCat Profile Picture
    18,228 Most Valuable Professional on at

    Hey I know this is already solved, but I'm just going to add here that I have a blog post that covers a regex formula that uses the RFC5322 standard.

     

    The Match.Email is way too wide in terms of regex validation and allows addresses that are absolutely not valid email addresses - I have examples of these in the blog and examples of better regex code that youcan copy/paste for use in your Apps 🙂

     

    Email validation in Power Apps - iAm_ManCat Blog (iammancat.dev)

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard