In Sharepoint 2010 we can easily validate the column values entered into list items.
We have two levels of validation:
- Column level
- List level
Both of them use Sharepoint Formulas. Here you can find a complete list of formulas and functions
and the description of each of them:
I will show two simple examples of how to use column validation, at column level and at list level.
Example 1 : Column Level Validation.
Create a new column on a list, click 'column validation':
Into the 'Formula' text area add a validation Formula. For example, I'll add a very simple E-mail format validation:
Note that into 'User message' text area you can enter the message you want the user see when the validation is not passed.
Example 2 : List Level Validation.
- In the List Settings, click on 'Validation Settings'.
Into the 'Formula' text area add a validation Formula. For example, this formula check that Value3 is the biggest and Value2 is bigger than Value1*.
We have to take into account that Sharepoint evaluate firstly the 'Column Level' Formulas and then the 'List Formulas'.
So, what if List and Column level validations are in conflict?.
•On the one hand we have the following List level Validation:
•On the other hand we have the following Column level Validation:
As a result of the conflict, in this case, it will impossible to submit a list item.