cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper 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
Highlighted
Super User III
Super User III

Re: TO Email TextField Validations

@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."

Highlighted
Helper I
Helper I

Re: TO Email TextField Validations

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (6,594)