Hello everybody,
I start on Appian, and I would like to control the mail adress format on an interface (presence of @, followed by a point ...).
How to do ?
Thaks for your help
Discussion posts and replies are publicly visible
A quick way (though not fully correct) to check the conditions you listed would be to use the following expression:
= with( local!at: find("@", ri!email), local!dot: find(".", ri!email, local!at), and(local!at>1, local!dot>local!at+1))
You'd need to add logic to disallow a@b..c and other invalid inputs.
Also check other posts on the same subject: https://community.appian.com/discussions/f/administration/7353/way-to-validate-email-addresses, https://community.appian.com/discussions/f/user-interface/6070/greetings-i-am-trying-to-validate-my-a-textfield-content-whether-it-is-an-valid, etc.
I posted a fairly robust out-of-box Appian-based validation rule that I've developed and refined over several years, to the first thread Carlos Santander linked above. If you decide to try that, please feel free to let me know if you have any issues.
You can use following to validate an Email Address as Mike mentioned above
if( or( len(trim(ri!address)) > 255, length(split(trim(ri!address), " ")) > 1, count(split(ri!address, "@")) <> 2 ), false(), with( local!localPart: split(trim(ri!address),"@")[1], local!domainPart: split(trim(ri!address),"@")[2], if( or( length(split(local!domainPart, ".")) < 2, contains(split(local!localPart, "."), ""), contains(split(local!domainPart, "."), ""), not(isnull(stripwith(lower(local!domainPart), "abcdefghijklmnopqrstuvwxyz1234567890-."))), not(isnull(stripwith(lower(local!localPart), "abcdefghijklmnopqrstuvwxyz1234567890-._+'&%"))), not(isnull(cleanwith(right(local!domainPart,1), "1234567890-"))) ), false(), true() ) ) )