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

Advent Calendar Door 15: Advanced validation in SharePoint list forms.

avatar

Posted by Adis Jugo - 15 Dezember, 2017

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.

 

Topics: Office 365, Sharepoint, SharePoint Online


Recent Posts

Business Apps on Office 365 and Teams are the next big thing

read more

The real digital workplace

read more

A personal letter to all Microsoft Cloud Solution Providers

read more