Add more than 5 conditions in InfoPath form's rule

Best way to add more than 5 conditions in InfoPath forms rule

No comments

 26,332 total views,  11 views today

PLC Training 55 - Design ladder l...
PLC Training 55 - Design ladder logic for 3 way Traffic Light Control

More than 5 conditions in InfoPath forms rule – Infopath form was one of best lightweight form designer tools 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.

Conditions in InfoPath forms 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. 

Conditions in InfoPath forms rule - 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.

Add more than 5 conditions in InfoPath forms rule (complex condition expression InfoPath)

Then, how we can add more than 5 conditions to handle the disabled 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 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 as you want and/or conditions. 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 the 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.

Conditions in InfoPath forms rule - 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: Conditions in InfoPath form rules (complex condition expression InfoPath)

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: SharePoint Online tutorial

You may also like the below SharePoint Online tutorials:

PDF Download Image

Download SharePoint Online & Office 365 Administration eBook

Buy the premium version of SharePoint Online & Office 365 administration eBook from here:



Buy SharePoint Online & Office 365 Administration eBook


 

Get the free demo PDF eBook from here:

FREE DOWNLOAD

Send download link to:

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

About Post Author

Do you have a better solution or question on this topic? Please leave a comment