<img height="1" width="1" src="https://www.facebook.com/tr?id=730305433807073&amp;ev=PageView &amp;noscript=1">
Book a Demo
Start

Advent Calendar Door 15: Advanced validation in SharePoint list forms

Advanced validation in SharePoint list forms

Validation in list forms is again one of the evergreens for SharePoint professional developers and solution creators alike. In today’s skybow Advent Calendar cookie, we will see how to create form validation – regardless if simple or advanced– with skybow Solution Studio and skybow Rich Forms.

Imagine there would be a requirement to validate the form field “Request Notes”, in a way that it has to contain at least 100 characters, for everyone, except for the members of the “Management” SharePoint group (because managers don’t need to explain anything, obviously 😊).

We will open that list form, either with skybow Solution Studio or skybow Rich Forms, select the “Request notes” field, and then set the following validation expression:

[[@User.IsMemberOfGroup("Managers")]] ? true :

([[requestnotes]].length > 100)

This expression in skybow Expression Language (which is a SharePoint-supercharged JavaScript) basically checks if the current user is member of the “Managers” group, and if not, checks if the “Request Notes” field’s length is larger than 100 characters.

In the “Validation text” field, we have a simple statement that the length needs to be larger than 100 characters.

Validation Condition skybow

You can create arbitrary complex validations with skybow Expression Language, either using assignment expressions like this one (those are usually Excel-like formulas), or, if you feel like it, more complex code blocks using Function code expressions which allow full blown JavaScript.

The result, when you run this form and try to fill in the form with too short Request note will be as following.

Request more Information Rich Forms

Altogether, it took us less than 5 minutes to achieve this with skybow Solution Studio or skybow Rich Forms.

 

Adis Jugo

Written by Adis Jugo

is Director of Product Technology at skybow, and a software architect with over 20 years of experience. Adis is double Microsoft MVP (Most Valuable Professional) for Office Development and for Office Servers and Services. He first met SharePoint (and Microsoft CMS server) back in 2002, and since 2006 his focus was completely shifted towards architecture and development of productivity solutions, now based on the Azure, Office 365 and SharePoint technologies. Adis is an internationally recognized speaker with over 15 years of speaker experience, speaking at various Microsoft, Community and SharePoint/Office 365/Azure conferences worldwide.