Add more than 5 conditions in InfoPath form’s rule

No comments

 3,858 total views,  2 views today

Infopath form was one best lightweight form designer tool from Microsoft Office product, but unfortunately from the year 2022, Microsoft will stop support for Infopath Form. But still, in the industry, the Infopath form has been used widely. As we know in Infopath form we have the limitation of writing 5 conditions in the rule, after writing 5 conditions the “And” button will be disabled – but it is very much needed for the business logic to have more than 5 conditions. So, here I will share some techniques about how we can add more than 5 conditions in the Infopath form’s rule.

Below is my Infopath form where I want to disable the checkbox until all 9 textbox fields have been filled-up.

But as we see in the below screen after adding 5 conditions the last “And” button is disabled. 

Add more than five conditions in the Infopath form rule
Add more than five conditions in the Infopath form rule

We see the “And>>” button is disabled, after adding 5 conditions because in the traditional way Infopath does not allow to add more than 5 conditions.

Then, how we can add more than 5 conditions to handle the disable logic.

Yes, we can there is another way to do this. In the last rule, here it is “field5” click on the “The expression” from the dropdown list as like below:

Add more than five conditions in the Infopath form rule - The expression
Add more than five conditions in the Infopath form rule – The expression

Once we click on the “The expression”, will get the below text.

Add more than five conditions in the Infopath form rule - The expression box
Add more than five conditions in the Infopath form rule – The expression box
my:field5 = ""

Copy the above text in the notepad or any text editor.

And write as many you want and/or condition. For this demo scenario, I have added or condition. 

my:field5 = "" or my:field6 = "" or my:field7 = "" or my:field8 = "" or my:field9 = ""

Then finally, copy the modified text into the same box.

Multiple conditions inside the Infopath -The expression box
Multiple conditions inside the Infopath -The expression box

When we have a requirement to add multiple and/or conditions (more than 5), then we can use the above expression technique to handle the scenario. 

Demo: 

Once we add the rules to handle the multiple conditions something like below:

if "field1" is blank or
if "field2" is blank or
if "field3" is blank or
if "field4" is blank or
my:field5 = "" or my:field6 = "" or my:field7 = "" or my:field8 = "" or my:field9 = ""

Then

Disable this control

In the below example, the checkbox will only be enabled if all the textbox is filled up.

Disable the check box until more than five fields are filled up in the Infopath Form
Disable the checkbox until more than five fields are filled up in the Infopath Form

Summary:

Hence, in this article, we have learned about the technique we can add more than 5 conditions in the Infopath form’s rule.

See Also:

Free download SharePoint Online & Office 365 Administration eBook(238 Pages)

Get the PDF eBook from here:


[purchase_link id="0" style="button" color="blue" text="Free Download SharePoint Online & Office 365 Administration"]

 

 
FREE DOWNLOAD

Send download link to:

Subscribe to get exclusive content and recommendations every month. You can unsubscribe anytime.