Implement List Level Validation In SharePoint 2016

SharePoint provides out of the box column validation to check for the correctness of the data entered in the list. The validation takes the form of Exce- like formulas to work on the list data. We can have two levels of validation, which are-

  • Column level validation and
  • List level validation

In this blog, we will see how to work with the list level validation to compare the two dates and save the list item only if the due date field is greater than today's date.

Due
We have two date fields Due Date(SLA) and Issue Reported Date, which are set by default to today. Lets add a validation formula by selecting the 'Validation Settings' from 'List Settings' page.

Settings'

Add the formula to the text box. The formula will return true only, if the Due Date is greater than Today’s date, else it will return False and the 'User Message' will be displayed without saving the list item.

displayed
Now, let’s try saving a list item with Due Date as Today.

saving
It will show the custom error message without saving the list item. Similarly, we can have the validation formulas at Column level as well.The major difference between List and Column level validations are that List Level Validation can have any of the list fields in the formula. However a Column level Validation can only have that specific column in the formula.

Summary - Thus, we saw how to implement the list level validation in SharePoint to validate the data before saving to the list.