SharePoint email address column validation

I was looking for code to validate a list column as an email address. I came across this post ( thanks Chris Kent ) which gave me the answer:

=AND(
ISERROR(FIND(" ", [Email],1)),
IF(ISERROR(FIND("@", [Email],2)),
 FALSE,
 AND(
ISERROR(FIND("@",[Email], FIND("@", [Email],2)+1)),
 IF(ISERROR(FIND(".", [Email], FIND("@", [Email],2)+2)),
 FALSE,
 FIND(".", [Email], FIND("@", [Email],2)+2) < LEN([Email])
 ))) )

Its a little piece of magic ....

Comments

Popular posts from this blog

SharePoint 2013: Error updating managed account credentials

How can I call a JIRA api through Powershell?