Skip to main content
Nintex Community Menu Bar

Formula to make a field mandatory on condition A or B


Forum|alt.badge.img+3

I tried this formula but it did not work to make a field mandatory on condition: it must have a value if Request type=Add New Supplier or Request Type=Activate Supplier.  

 

Formula Builder

isNullOrEmpty({Self}) and(equals(Request_Type, 'Add New Supplier')or(Request_Type, 'Activate Supplier'))

The form can be saved without having a value this field.

 

Can someone give me a tip how to correct that formula?

 

Thanks in advance!

Translate
Did this topic help you find an answer to your question?

4 replies

Forum|alt.badge.img+12
  • 848 replies
  • April 27, 2018

Hi Isabel,

the operators work a bit different.

Instead of [Condition 1]and[Condition 2] they work like and([Condition 1], [Condition 2])

so what should be working is

and(isNullOrEmpty({Self}), or(equals(Request_Type, "Add New Supplier"), equals(Request_Type, "Activate Supplier")))

For usage of other runtime functions this might help too: Runtime functions 

Best regards

Enrico

Translate

Forum|alt.badge.img+3
  • Author
  • 19 replies
  • April 27, 2018

Thanks Enrico,  I got this to work.

But now I have a similar issue:  A control needs to be hidden if meet 3 conditions. I used this formula but only first two conditions work, the 3rd one has no effect:

Formula Builder

equals(Request_Type, 'Add New Supplier') || equals(Request_Type, 'Activate Supplier') || equals(Request_Type, 'Deactivate supplier')

Does OR only work for two not three?

Translate

Forum|alt.badge.img+3
  • Author
  • 19 replies
  • April 27, 2018

I got this to work by using Not(equals(… )   there is only one value need to match for this control to display, so if value not equal this value then hide.

Translate

Forum|alt.badge.img+4
  • Rookie
  • 23 replies
  • August 27, 2021

 


I have a Nintex form with two fields as follows:


Accessby : drop down field


Approval : people field (hidden by default, shown only based on the value of Accessby)


 



  1. I need to hide Approval by default and show Approval field only when Accessby is showing 3 values e.g. "Cat1" "Cat2" "Cat3" (applied hide rule which is working fine)

  2. When Approval field is shown, I want to make sure users fill in at least one person and not leave as empty field.


 


I tried the following at the Rule section of the Approval field, but the system does not do Step 2 above, what is the correct formula to ensure that the Approval field is not empty when shown? :



  1. and(isNullOrEmpty({Self}), or(equals(Accessby, "Cat1"), equals(Accessby, "Cat2"), equals(Accessby, "Cat3")))

  2. isNullOrEmpty({Self}) and (Accessby == "Cat1" or Accessby == "Cat2"or Accessby == "Cat3") 

  3. isNullOrEmpty({Self}) && (Accessby == "Cat1" || Accessby == "Cat2" || Accessby == "Cat3") 


 


When I tried isNullOrEmpty({Self}) alone, the system immediate prompt me that the Approval field is empty even though the Approval field is hidden (note that I did not tick the "validate when hidden")


 

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings