cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

rule to make a field mandatory depending on a lookup field

Jump to solution

Hi,

As the title says, I need to make a field mandatory when another field (lookup) has a specific value.

I tried to add a rule on the field, something like this isNullOrEmpty({self}) && myLookupField​==5 (myLookupField is a dropdown control), bu it does not work.

Does anyone have an idea what is wrong?

Thanks

Labels: (1)
0 Kudos
Reply
4 Replies
Highlighted
Automation Master
Automation Master

Re: rule to make a field mandatory depending on a lookup field

Jump to solution

Is 5 the value or the ID? Sometimes lookups use an id of 5;#Value so you may not be matching.

Reply
Highlighted
Automation Master
Automation Master

Re: rule to make a field mandatory depending on a lookup field

Jump to solution

Confirming what Andrew said (I just went and tested it on a lookup field).  Then you have the dilemma of trying to figure out what ID is associated with the lookup display value.  I'd use the contains function as it's cleaner than supplying both the ID and display value.  i.e.

Assuming your lookup list has id 5 and value "Green Apples":

isNullOrEmpty({self}) && contains(myLookupField, "Green Apples")

vs

isNullOrEmpty({self}) && myLookupField=="5;#Green Apples"

View solution in original post

Reply
Highlighted
Automation Master
Automation Master

Re: rule to make a field mandatory depending on a lookup field

Jump to solution

Nice, thanks Chris. Tag team!

Reply
Highlighted
Not applicable

Re: rule to make a field mandatory depending on a lookup field

Jump to solution

Thanks for the answer

0 Kudos
Reply