In this post, we will discuss how we can implement validation rules by the condition in Nintex forms for Office 365 SharePoint online. We can implement rules very easily by using various functions, field etc which are available in Nintex forms. If you are starting with Nintex forms then you can read: Working with Nintex Forms for Office 365.
In this example I have a drop-down list which has two option: Approve and Reject. My requirement is if the user selects the Approve button then there should not be a validation. But if user select Reject option, the user has to put some comment for rejection in a multiline textbox.
Also, you can read:
– Create List Definition and List Instance in SharePoint 2013 using Visual Studio 2013
Follow the below steps:
First Open your SharePoint online site and the open the particular list. From the list, ribbon click on Nintex Forms option which will open Nintex form designer.
Then In the Nintex form designer, Drag and drop a Choice control from Forms Controls toolbox. Then double-click on the Choice box to open Settings dialog box. Here give a name for the choice control. Then select the display format, I want this to appear as a drop down list, so I selected Drop down list option. Then put the values, here I want only two options to Approve and Reject. So add Approve, Reject (separate by comma). The settings will look like below:
Then drag and drop a Panel control to the form and double-click on the Panel to open the Control Settings dialog box. Here give a name and Title put some meaningful message which will appear in the panel. It looks like below:
Now drag a multiline textbox inside to the panel. Double click on the Multiline textbox to open settings dialog box. Give a name form the multiline textbox and then Save.
Now it is time to add our rules to the control.
Select the Panel control and then from ribbon click on Add Rule button. Once it will open give a name for the rule and then select Rule Type as Formatting. Then in the Condition box, click on fx button. Here we will write a rule to show the comment box when user selects the Reject button. Here select from Named Controls select the drop-down list name, then from the Operators select the “!=” operator. Then write “Reject”. So the rule should be: choiceApproveReject !=”Reject”. Then in the Formatting option, choose the Hide option. The rule should look like below:
So the rule is like:
txtRejectComments ==”” && choiceApproveReject==”Reject”
And type validation message as “Please enter rejected comment.”
So the rule should look like below:
Now publish the form and then try to create a list item as shown in the fig below: If you select Reject option and then try to submit it will display the error message as shown in the fig below:
Hope this will be helpful.
Download FREE SharePoint 2019 Installation PDF Guide
This FREE PDF contains, Steps by step guide to install SharePoint 2019 Preview, prerequisites, hardware and software new features. First impression to SharePoint Server 2019 new modern site, modern lists and modern document libraries.
You May Also like the Following SharePoint Online Tutorials: