It is a very common business requirement, where we may need to validate date fields in SharePoint Lists. We can implements validations using calculated columns as well as we can use JavaScript to validate date columns in SharePoint. But recently I was trying to do this using Infowise Ultimate Forms, I will show here how we can do easily implement and maintain validations in list forms using Infowise Ultimate Forms.
SharePoint 2016 Tutorial Contents
Here I have a tasks list as “Infowise Ultimate Form Tasks” which has a Start Date and Due Date column which are of type Date type filed. Here we will validate two things:
- Start Date Can not be less than today
- Start Date Can not be greater than Due Date
Configure Validation in Infowise Ultimate Forms
First thing is we can add the Infowise Ultimate Forms to SharePoint online site. Then you can see a “Design” option in the ribbon, on click of that it will open the “Infowise Ultimate Forms” Designer.
Infowise ultimate forms Date validation
In the designer, you can see “Configure Defaults and Validation” section, there click on “Column Validation”.
Infowise Ultimate Forms Column Validation
This will open “Column validation: Infowise Ultimate Form Tasks” screen where you can see all the existing validation rules as well as you can add/update new validation rules.
Go to the “Add/Update Validation Rules” section, choose like below:
- Column -> Start Date
- Type -> Column
- Operator -> greater than
- Value -> [Today]
- Error Message -> <Your custom error message>
You can choose the Value from Value Picker like below:
Infowise Ultimate Forms Column Validation add value picker
Now the screen will look like below and there click on Add.
Infowise Ultimate Forms configure date validation
Similarly, we will add another validation to validate Start date should not greater than Due date. In the Add/Update rule fill like below;
- Column -> Start Date
- Type -> Column
- Operator -> less than
- Value -> [Due Date]
- Error Message -> <Your custom error message>
The rule should look like below:
Infowise Ultimate Forms configure Start date and due date validation
Now, you can see both the rules in the “Existing Validation Rules”:
Infowise Ultimate Forms configure Start date and due date validation
Make sure to click on the “Save” button to save the rules. Now we can test the rules.
Testing: Start Date Can not be less than today
Open the SharePoint list for which we have added the validation rules and try to add an item to the list. Here I have chosen the Start date as the day before yesterday’s date. And when I try to add an item it will display me the error message:
Infowise Ultimate Forms configure Start date and due date validation
Testing: Start Date Can not be greater than Due Date
Similarly, we can test the other scenario where wanted to check Start date should not be greater than the due date. Now I tried to give the Start date greater than Due date, and it shows me an error saying Start date cannot be greater than the due date.
Infowise Ultimate Forms Date Field Validation
Another important thing is, you can see all the validation or rules at one place and add/modify or delete easily.
Conclusion:
We had seen here how easily we can add validation rules to date fields in SharePoint online list. You can try Infowise Ultimate Forms now.