Skip to main content
haripriyas
New Participant
Sep 1, 2021 12:10 PM UTC
Question

validateemailaddress() ?

What all cases are covered while using validateemailaddress() ?

11 replies

stefanhelzle0001
Brainy
Sep 1, 2021 1:09 PM UTC

As this is no function of the Appian product, you would need to check the code.

New Participant
Sep 1, 2021 7:39 PM UTC

you can get the list of valid emails from google http://softwaretesterfriend.com/manual-testing/valid-invalid-email-address-format-validation/

Tried some based on the valid email format mentioned in the site for some it didnt work.

New Participant
Aug 17, 2022 8:18 AM UTC
[deleted]
mikes0011
Brainy
Aug 17, 2022 12:14 PM UTC

nice try...

The Expression Guru
Participating Frequently
Dec 13, 2022 12:57 PM UTC

No all the cases will not be covered using that function. 

You can use the below regex expression to check that 

"^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+$"
Known Participant
Dec 14, 2022 4:05 AM UTC

for validating email address you can use this regex 

regexmatch("^[\w\.\-]+@[\w\.\-]+\.[\w\.]{2,}$",ri!input)

mikes0011
Brainy
Dec 16, 2022 3:53 PM UTC

This pattern fails a bunch of the test cases I have set up in my Validate Email Addresses expression rule.  Two of the most obvious/important failure cases is that it doesn't return "false" for email addresses beginning or ending with extraneous periods (".").

This is the pattern I use in mine, which passes a rather rigorous 18 test cases (though i can't guarantee it passes all realistic ones, just the ones i've been able to think of).

regexmatch(
  pattern: "^[A-Z0-9\'\+\&\%_-]+(\.{0,1}[A-Z0-9\'\+\&\%_-]+)*[@]{1}[A-Z0-9.-]*[A-Z0-9-]+[.]{1}[A-Z]{2,6}$",
  searchString: ri!email,
  regexFlags: "si"
)

Also note: all of the above test cases also correctly pass using the "validateEmailAddress()" function from People Functions, for what it's worth.

The Expression Guru
davinar9817
Known Participant
Dec 16, 2022 4:03 PM UTC

Is there a way to display a message instead of a boolean value with this?

zeldat7413
New Participant
Mar 17, 2023 4:47 AM UTC
[deleted]
Participating Frequently
Mar 17, 2023 5:36 AM UTC