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

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (47,145)