Capital Letter Validation in SharePoint

Capital Letter Validation in SharePoint
4 votes, 4.50 avg. rating (90% score)

Introduction

Hope my series of SharePoint validation articles helps everyone to resolve their issues right from basics to advanced.
You can check my other series of posts

How to implement validations in Detail http://adicodes.com/column-validations-and-list-validations-in-sharepoint-2010/

How to implement Date Validation based on a scenario
http://adicodes.com/date-validation-in-sharepoint/

In this post we will cover the below scenario. This scenario is one of the basics to understand more complex validations further

Scenario – First letter of the user input should be capital letter

I am using the following List Column and type in the example
FirstName – Single line of text

Formula and validation message setting





This is column level validation as formula involves with itself not with another column. So, validation rule should be provided at
List Settings > select column FirstName under columns > Add formula under Column Validation
(FirstName is the column we are implementing according to our scenario)

Validation Message

Formula





=CODE(UPPER(MID(FirstName,1,1)))=CODE(MID(FirstName,1,1))
MID(FirstName,1,1) – this gets the first letter from the user input. In our case, according to the above input (adiseshu), it gets ‘a’.
UPPER(MID(FirstName,1,1)) – converts ‘a’ to ‘A’
CODE(UPPER(MID(FirstName,1,1))) – get the ASCII of ‘A’

This ASCII code should be equal to the value given by the user. If they are not equal, it is an invalid input.
You can refer list of ASCII codes here http://www.asciitable.com/

Conclusion

We will further cover some good scenario’s and hope you will enjoy implementing them wherever required. If you are looking for any specific scenario formula, please post a comment and I will try to provide the formula or I will certainly help you to get it resolved :)

November 7, 2013 В· Adi В· One Comment
Tags: , ,  В· Posted in: Sharepoint 2010, SharePoint 2013, Validations

One Response

  1. Richard Grantz - May 17, 2014

    Could you advise the column validation formula for an email address that must end with .mil?
    Any assistance that you can provide will be greatly appreciated

Leave a Reply

What is 3 + 15 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)