SharePoint Column Validation Examples

In this SharePoint column validation example, we will discuss how to add validations to the SharePoint column and where we add the column validation rule in SharePoint 2013/2016/Online. Here we will discuss how to add the validation in the SharePoint custom list column.

Validations are very much necessary in SharePoint 2013/2016/Online list columns.

Here I have a SharePoint Online list as “StudentInformation” and I will show you how to add column validations in SharePoint Online/2013/2016 list.

Here we will see few SharePoint column validation examples:

  • SharePoint email column validation
  • SharePoint phone number column validation
  • SharePoint date column validation
  • SharePoint text column validation
  • SharePoint column validation number of digits

SharePoint email column validation

Now, we will see an example on SharePoint email column validation.

For the mail id validation, I have created one single line of a column named “StudentEmailId”. When You are creating the “StudentEmailId” column in the create column page scroll down the page we can able to see the “Column Validation” option.

Click on the “Column Validation” option, we can able to see two fields one for formulas and one is user message.

Here I want to set the validation for “StudentEmailId” column. When the user entered the wrong email id then the user message will display as a warning message.

In the formula field, I have added the below formula

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

In the User message field, I have added the message “Enter The Valid Email Id”. When a user goes to add the new item to list and enter a valid email id in the email id field it will save the data to the list. The User message will display if the Email Id is invalid.

sharepoint email column validation

SharePoint phone number column validation

Now, we will see an example on SharePoint phone number column validation.

I have created one column named “PhoneNumber” in the SharePoint list and in the Formula field of Column validation I have added the below formula.

=AND(LEN(PhoneNumber)=14,IF(ISERROR(FIND("+",PhoneNumber,1)),FALSE,(FIND("+",PhoneNumber)=1)),IF(ISERROR(FIND("-",PhoneNumber,4)),FALSE,(FIND("-",PhoneNumber,4)=4)),IF(ISERROR(1*CONCATENATE(MID(PhoneNumber,2,2),MID(PhoneNumber,5,10))),FALSE,TRUE))

In the User message I have added the message “Enter the valid mobile number”.

According to formula if the user gives the mobile number in the below format then only the field will take the mobile number.

Ex:+91-**

I have created a new item in the phone number field I have given the number as “+91-**” So the number is stored to the SharePoint list.

SharePoint date column validation

Now, we will see how to an example on SharePoint date column validation.

Here we will see the Date validation. I have taken one column of “date and Time’ datatype in SharePoint custom List and give the list name as “StartDate”, see the above screenshot. In the column validation, I have added the formula

=StartDate>TODAY()//Start date should be more than today

In the user message, I have added the message “Start date should be greater than today”.

SharePoint text column validation

Now, we will see an example on SharePoint text column validation.

In the “StudentInformation” SharePoint custom List for checking the Name validation, I have Added one Single line of a column named the column name as “Fullname” and in the Column validation in the rule field I have added the rule

=OR(LEN(Fullname)=9,LEN(Fullname)=12)

I want The length of Fullname should be 9 or 12. In the user message, I have added the message “Enter the 9 letter name or 12 letter”.

SharePoint column validation number of digits

Now, we will see an example of SharePoint column validation number of digits.

Here I want to put the validation that when the user enters the number then the length of the number should be more than 5. So I have created a “StudentRN” column which data type is a single line of text.

In the Column, validation writes the below formula:

=IF(LEN(StudentRN)>5,TRUE,FALSE)

and in the “User message” field put the text. Here I have added the text “Enter The number which range is more than 5” in the User message Field.

When We want to Add a new item to the list and without obeying the validation condition and Click on Save it is showing all the “User message” below the field.

SharePoint column validation number of digits

In this SharePoint article, we were discussed how to add validation in the list column in SharePoint Online/2013/2016.

Here we see few SharePoint column validation examples:

  • SharePoint email column validation
  • SharePoint phone number column validation
  • SharePoint date column validation
  • SharePoint text column validation
  • SharePoint column validation number of digits

You may like following SharePoint Online tutorials:

>