How to do custom validation for site column in SharePoint

In this article we will be seeing how to do custom validation for site column in SharePoint using power shell and SharePoint object model.

I have created a list "Resume" where the users can upload the resume and will be filling some basic details. I have four columns:

  • Name

  • Email ID

  • Mobile No

  • Years of experience

I am going to do some custom validation for "Years of experience" column. Only users who have experience of 3-6 years can upload the resume.

I have created a custom validation as shown in the following which has the Formula and User message (where you can display some custom error message).

Go to SharePoint site -> List -> List Settings -> Columns -> click on the column to edit.