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 Apps
Answered

Email Verification

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi ,

 

I've a column in my power app where the user enters email 

the required filed is true 

when the user enters the email is their any way that I could validate the email address 

I don't need to validate on the basis of domain , I just need the mail should be in email format  if not I need the datacard should display an error message and turn the datacard column color to red  could any one help me on this

 

I tried to add an icon (warning ) inside the data card and set it icon function into following , but it is showing an error 

Emptyglasses_0-1678261623817.png

If(
IsMatch(
DataCardValue2_6.Text,
"^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$"
),
Green,
Red
)

Emptyglasses_2-1678261792722.png

Emptyglasses_3-1678261841021.png

 

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,373 Most Valuable Professional on at

    Hi @Anonymous ,

    Why not simply 

    If(
     IsMatch(
     DataCardValue2_6.Text,
     Match.Email
     ),
     Color.Green,
     Color.Red
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

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

    Hey @WarrenBelz 

     

    Be Careful with Match.Email - it doesn't actually validate emails!

    The string it uses for validation is:

    image.png

    Which means I can put any old crap in my textinput before the last @ and it will validate it as a valid email even if completely wrong!

    image.png

     

    Cheers,

    Sancho

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

    Hey @Anonymous 

     

    You are using colors in your Icon property - the Icon property expects an Icon-type - you need to move this code to the Color/Fill property of the icon 🙂

     

    Cheers,

    Sancho

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks for your advice ,

     How do u  suggest me to do proper email validation for my app

    I cann't use for domain validation since I got users from different entity 

    I their any way that I could validate like if the email entered by the user is not in the office 365 users it should show an error 

    is it possible  ? 

  • WarrenBelz Profile Picture
    156,373 Most Valuable Professional on at

    Thanks @iAm_ManCat ,

    I actually do not use it myself, but ran a test here and it appears to work

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

    it only validates if there's:

    (literally any characters) @ (literally any characters) DOT (literally any characters)

     

    It's not a valid email checker as it means people can enter invalid emails! just because a valid email also matches that pattern doesn't make it a valid one 🙂

     

    Try put this text in and ask it if it's a valid email:

    !($*&^!(@@@@@@%^.Harker@@.!&$*!@

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

    Yes, if you wanted to validate against internal emails only then that could work - you'd use Office365Users.SearchUser function - but in that case why not use a people picker? if you create a person column you should be able to insert that into a form and it will create the combobox for you that only takes in internal people

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi , Thanks for the response 

     

    The people picker step u  mentioned , I don't get it 

     what I was planning to do is to pass a code in my onselect of  my submit button , but its showing an error 

    Could u please help met fix it

    If(
    Office365Users.UserProfileV2(DataCardValue2_5.Text).id <> "",
    SubmitForm(Form1_5),
    Notify(
    "Please enter a valid email address",
    NotificationType.Error
    )
    )

     

    this is  working but if the user enter's a value which is not in the office 365 email  its display a very large error

    Emptyglasses_0-1678274134399.png

     

     

    please help me on this 

  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at
    If(
     Len(DataCardValue2_5.Text)>0 && Office365Users.UserProfileV2(DataCardValue2_5.Text).id <> "",
     SubmitForm(Form1_5),
     Notify("Please enter a valid email address",NotificationType.Error)
    )

     

    Could you try using that instead - that should check for if there is anything in the box first, not entirely sure it will negate the error - but we can try something else if that doesn't work 🙂

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi 

     

    Its working but the problem is the error displaying mode 

    Emptyglasses_0-1678333241136.png

     

    if u see the error screenshot the user won't be able to understand the reason behind it 

    is there is any way that I could hide it and display only this 

     Notify("Please enter a valid email address",

    or else is their is any other possibility that we could check the same when the user enters the mail in the Email ID column 

    I got stuck in this man 

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 429 Most Valuable Professional

#2
11manish Profile Picture

11manish 191 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 122 Super User 2026 Season 2

Last 30 days Overall leaderboard