cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Formula to make a field mandatory on condition A or B

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!

Labels: (1)
Tags (1)
0 Kudos
Reply
3 Replies
Workflow Hero

Re: Formula to make a field mandatory on condition A or B

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

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Formula to make a field mandatory on condition A or B

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?

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Formula to make a field mandatory on condition A or B

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.

Accept as Solution Reply