This SharePoint tutorial explains, an example of list validation in SharePoint 2013/2016/Online. We will see how to validate the expiry date should be greater than or equal to the created date in SharePoint.
Here I have an out of box Announcement list. In the announcement list, there is a Title, Body and Expires column. The Expires column is a date and time column which indicates the expiry date of the announcement. Here we will validate that the Expiry date should be greater than today. User should not add an announcement which is already expired.
SharePoint 2016/2013 provides out of box validation settings at the list level as well as in the column level.
The difference between the two methods is that using the column properties does not provide the ability to compare two columns in the same list, whereas the List Settings validation option allows us to validate using two columns. The column properties validation settings are useful when comparing a column value with a static value.
You can create an Announcement App using Announcement template in SharePoint. Then open the list and then from ribbon go to the LIST tab and click on the List Settings button. This will open the list settings page.
In the List Settings Page, click on Validation settings which are presented under General Settings.
In the Validation Settings page, in the Formula, it will display columns to insert into your formula. Write your formula like below:
Formula: =[Expires]>=[Today] User Message: Insert Future Announcements, this one already expired.
The formula looks like below:
Now try to add one announcement and choose the expiry date as less than today. You can see a validation message like below and it will now allow you to add the announcement.
But if you will add an announcement whose expiry date is greater than today it will allow to add.
You may like following SharePoint 2016 tutorials:
- Browsers Supported in SharePoint Online/2016/2013
- User Information List in SharePoint 2016/2013
- Alternate Access Mapping in SharePoint 2016
- All about Publishing Infrastructure Feature in SharePoint 2013/2016
- How to implement validation rules by a condition in Nintex forms for Office 365 SharePoint Online?
- SharePoint 2013/2016/Online List Column Validation Examples
This SharePoint tutorial we learned how to validate expiry date should be greater than or equal to created date in SharePoint 2013/2016/Online.
I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SPGuides.com