cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
u4jaanus
Resolver I
Resolver I

TO Email TextField Validations

Hi,

Trying to validate Text Field so I could use it to Pick Recipient Email address. I manage to validate it using regular Expressions however unable to finish it as I want.
regularExpression I have used is. 

^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})\$

This work fine for the email part but when I try to add more addresses in same text field i.e.
contos@contos.com; contos@contos.com ...
I am getting mismatch; any idea how to validate all email addresses and to make it mandatory to use ; if there is more than one email address OR if replace [SPACE] with ;SPACE to format it properly as user can send emails to multiple recipients this way.

Thank you

2 REPLIES 2
mdevaney
Super User III
Super User III

@u4jaanus 

Regular expressions are actually not necessary to validate an email in PowerApps.  You can do this in a simpler way

 

IsMatch(“yourname@your company.com”, Match.Email)

 

To determine if all emails in a string are valid you can use this comparison.  It asks: how many valid emails and does it match the total emails supplied.

 

CountRows(Filter(AddColumns(Split(“yourname1@yourcompany.com; yourcompany2@yourcompany.com”, “; “), “IsEmail”, IsMatch(Result, Match.Email))), IsEmail=true)=CountRows(Split(“yourname1@yourcompany.com; yourcompany2@yourcompany.com”, “; “))

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

I used regular Expression and This is what I did

IsMatch(EmailTextField.text,"^(([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)(\s*;\s*|\s*$))*$"),"Use ' ; ' if adding multiple email address", "Invalid Email Address")

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,804)