Column Validation in SharePoint 2010

Most of the developers faced issues with column validations in SharePoint 2003/2007.

It is really painful to write the validation using custom approach like javascript or jquery.

SharePoint 2010 provides the following validations in Out of the Box.

  • Column Level Validation
  • List Level Validation

Column Level Validation

While creating new column in list, click on the column validation node.

Specify your validation formula.

e.g.

[FieldName]=”Value”

The formula should return TRUE for validation to PASS.

Create New column in List and Specify the validation Settings.


Create new item in List, Click save to validate.

WOW….life is easy with SharePoint.

State Tuned to hear about List level validation in my next post.

8 comments to Column Validation in SharePoint 2010

  • […] In my earlier article, I wrote about column level validation in SharePoint 2010. […]

  • veenar

    Can we compare more than 2 conditons eg;
    If the textbox values can either be “NewYork” or “Washington” then how the formula must be.

  • Rao

    Good Stuff.

    I need to check it for e-mail validation. Can you please suggest me on this ?

    Thanks,
    Rao.

  • SPsidd

    I’m trying to use a Single line of text field with column validation to allow users to just type text into the column. The problem is that I can’t figure out how to allow multiple entries into the column.

    I have a validation formula that allows users to enter a single value such as “TC-12345” but how can I adjust the formula below to allow a user to enter something like “TC-12345; TC-23456; TC-34567” as well? Need to allow users to enter up to 20 separate values. My existing formula is below. Kindly suggesst what change i should do to achive my goal.

    =IF(LEN([4M_Delete Type])<8,
    FALSE,
    IF(LEN([4M_Delete Type])=8,
    IF(LEFT([4M_Delete Type],3)="TC-",
    IF(ISNUMBER(VALUE(RIGHT([4M_Delete Type],5))),
    IF(LEN(RIGHT([4M_Delete Type],5)=5),
    TRUE,
    FALSE),
    FALSE),
    FALSE),
    FALSE))

  • ccyborg

    this kind of formula is not taken into account by sharepoint 2010 :

    =AND(TRIM([BadgeOwnerFullName])=””,TRIM([BadgeOwnerAccount])=””)

    damage…

  • Zayno

    I want to put a text in uppercase but I get pa to do with validation formulas

  • Colin Phelps

    Does this mean that =AND cannot be used on Column Validation? If so, how does one do data validation on more than one condition?

    My case is that I have a field called WinChance that is a percentage in a custom list tracking projects and their likelihood to proceed. I am trying to ensure that if the column called ProjectStatus is set to “Won” that the WinChance field is set to 100%.

    I thought that a formula in the Column Validation for the WinChance column of =AND([ProjectStatus]=”Won”,[WinChance]<100 would have achieved this. However I get an error message of

    "The formula cannot refer to another column. Check the formula for spelling mistakes or change the column to this column."

    In my research I see (I believe) plenty of examples where validation is done between different columns. Or am I going crazy?

  • Ron

    Is there a way to create a Field validation that would require a length of 6 where the first 2 must be Letters the next 3 must be numbers and the last could be either

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>