Sunday, 1 November 2015

List column validation for special character in SharePoint (for any list eg Survey list, Discussion board list etc..)

Dear Pal,

A very useful article for validating the column for special characters. 

Step 1: Open Column Settings for which column you want to add the validations:
List Settings > Change Column > Column Validation (below Column Settings) 
Step 2: Add the following code at the Column Validation:
=AND(IF(ISERROR(FIND(",",[ColumnName])),TRUE),IF(ISERROR(FIND("&",[ColumnName])),TRUE),IF(ISERROR(FIND("!",[ColumnName])),TRUE),IF(ISERROR(FIND("@",[ColumnName])),TRUE),IF(ISERROR(FIND("~",[ColumnName])),TRUE),IF(ISERROR(FIND("#",[ColumnName])),TRUE),IF(ISERROR(FIND("$",[ColumnName])),TRUE),IF(ISERROR(FIND("%",[ColumnName])),TRUE),IF(ISERROR(FIND("*",[ColumnName])),TRUE),IF(ISERROR(FIND("(",[ColumnName])),TRUE),IF(ISERROR(FIND(")",[ColumnName])),TRUE),IF(ISERROR(FIND("-",[ColumnName])),TRUE),IF(ISERROR(FIND("+",[ColumnName])),TRUE),IF(ISERROR(FIND(":",[ColumnName])),TRUE),IF(ISERROR(FIND(";",[ColumnName])),TRUE),IF(ISERROR(FIND("[",[ColumnName])),TRUE),IF(ISERROR(FIND("]",[ColumnName])),TRUE),IF(ISERROR(FIND(".",[ColumnName])),TRUE),IF(ISERROR(FIND("/",[ColumnName])),TRUE),IF(ISERROR(FIND("\",[ColumnName])),TRUE))


Step 3: Type the User Message

for eg: Invalid character or Special Character not allowed. 

Cheers, Enjoy !!

No comments:

Post a Comment