Hi,
Does anyone know of a stronger version of email address validation than the out-of-the-box one? (IsMatch( [EmailAddressFieldName], Email).
In particular, I want to stop the following possibilities from being accepted:
Essentially, I would like if if the text input field accepted ONLY 1 valid email, and nothing else, no other characters, no other email addresses. Essentially anything that would stop a Power Automate email flow from running, that triggers from the form being submitted in the Power App (I'm not sure what Power Automate is using to decide the content in it's To/Cc/Bcc fields is valid before it decides to fail or not). I'm fine with it failing after Outlook attempts to send it (e.g. a valid email address but one that doesn't actually exist) because then it returns an error notification email back to the user who then knows how to deal with it. The trouble with it failing in Power Automate is the user can't see why.
Thanks 🙂
Solved! Go to Solution.
Hi,
You may use the below formula for Email Check
If(And(IsMatch(TextInput2.Text,Email),Not(Find(" ",TextInput2.Text)>0),Not(Find(",",TextInput2.Text)>0),Not(Find("(",TextInput2.Text)>0)),"Good","Bad")
and set a error handler in flow by adding one more action of Email Send to User by add a Parallel branch Just down to your Email Option where you are using these mail id and from Option (...) of New Email action select the "Configure Run After" Option and choose to "Has Failed". (see the attachment for reference)
Hope it will help you.
Hi @eka24 and @KrishnaV thanks for your replies but that wasn't quite what I was looking for sorry.
Hi @VDS_Mantra, that is great, thanks!! I've used your code and added a few more characters in just based on some of the failure examples I had:
If(And(IsMatch(TextInput2.Text,Email),Not(Find("(",TextInput2.Text)>0),Not(Find(")",TextInput2.Text)>0),Not(Find(",",TextInput2.Text)>0),Not(Find(":",TextInput2.Text)>0),Not(Find("<",TextInput2.Text)>0),Not(Find(">",TextInput2.Text)>0),Not(Find("[",TextInput2.Text)>0),Not(Find("]",TextInput2.Text)>0),Not(Find("\",TextInput2.Text)>0)), "Good","Bad")
Thanks for the error handling info too, I'll look into that as well.
I've learnt a lot more about email validation from this, it was a lot more complex than I expected, such as is described on Wikipedia (https://en.wikipedia.org/wiki/Email_address). I've decided to submit an idea too on the community to request a stronger inbuilt email validation function, if you're interested in voting for it the link is here.
@rhiheu Try:
On the Fill property
Hi @eka24, thanks for your reply. Sorry, I mean for it to accept any valid email and no other content in the field, not just abc@gmail.com.
In that case use:
IsMatch( "abc@gmail.com",Email)
Or
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Hi,
You may use the below formula for Email Check
If(And(IsMatch(TextInput2.Text,Email),Not(Find(" ",TextInput2.Text)>0),Not(Find(",",TextInput2.Text)>0),Not(Find("(",TextInput2.Text)>0)),"Good","Bad")
and set a error handler in flow by adding one more action of Email Send to User by add a Parallel branch Just down to your Email Option where you are using these mail id and from Option (...) of New Email action select the "Configure Run After" Option and choose to "Has Failed". (see the attachment for reference)
Hope it will help you.
Hi @rhiheu ,
you can't control the user to enter the external domain emails. However, if you want to check within the domain you can do this:
If(IsBlank(LookUp(Office365Users.SearchUserV2().value, Mail = TextInput20.Text).Mail),"Not a Valid Email","Valid Email")
I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.
Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.
Hi @eka24 and @KrishnaV thanks for your replies but that wasn't quite what I was looking for sorry.
Hi @VDS_Mantra, that is great, thanks!! I've used your code and added a few more characters in just based on some of the failure examples I had:
If(And(IsMatch(TextInput2.Text,Email),Not(Find("(",TextInput2.Text)>0),Not(Find(")",TextInput2.Text)>0),Not(Find(",",TextInput2.Text)>0),Not(Find(":",TextInput2.Text)>0),Not(Find("<",TextInput2.Text)>0),Not(Find(">",TextInput2.Text)>0),Not(Find("[",TextInput2.Text)>0),Not(Find("]",TextInput2.Text)>0),Not(Find("\",TextInput2.Text)>0)), "Good","Bad")
Thanks for the error handling info too, I'll look into that as well.
I've learnt a lot more about email validation from this, it was a lot more complex than I expected, such as is described on Wikipedia (https://en.wikipedia.org/wiki/Email_address). I've decided to submit an idea too on the community to request a stronger inbuilt email validation function, if you're interested in voting for it the link is here.
User | Count |
---|---|
163 | |
95 | |
77 | |
72 | |
58 |
User | Count |
---|---|
216 | |
166 | |
97 | |
96 | |
74 |