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.
You can check some of my previous posts on InfoPath alternatives for designing SharePoint Forms, Top SharePoint Workflow and Forms Applications Price Comparison, Update Field Value without using Workflow by using Infowise Update Action, Infowise Actions vs SharePoint workflows, Easily Configure Email Notifications using Infowise Ultimate Forms action, Infowise Actions vs SharePoint workflows: Copy List Item easily using Infowise Action SharePoint Online, Infowise Actions Vs SharePoint Workflow: Automate Site Creation process Infowise Ultimate Forms Create a Site Action in SharePoint.
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.
In the designer, you can see “Configure Defaults and Validation” section, there click on “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:
Now the screen will look like below and there click on Add.
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:
Now, you can see both the rules in the “Existing Validation Rules”:
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:
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.
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.
After working for more than 15 years in Microsoft technologies like SharePoint, Office 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Out audiences are from the United States, Canada, United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a SharePoint MVP(8 times), check out My MVP Profile. I have also worked in companies like HP, TCS, KPIT, etc.