Field Validation based on multiple values

  • 19 January 2018
  • 3 replies
  • 0 views

Badge +3

I am trying to make a field required based on the input of two fields. 

Design Type: a choice field

Complexity: a choice field

Person: Person

I want Person to be required based on the values chosen from Design Type and Complexity. 

Example.

If Design Type = "A" and Complexity = "Medium" or "High" make Person required. 

Can anyone tell me the validation syntax I need to enter on the Person validation rule to make this work?


3 replies

Userlevel 5
Badge +14

The following should do what you're describing. 


(Design Type === "A" && (Complexity === "Medium" || Complexity === "High")) && isNullOrEmpty({Control:Self})

To break that down. 

1. does Design Type equal "A" ? If it does then...
2. does Complexity equal either "Medium" or "High"? If it does then...

3. does the current person control contain an invalid entry? 

This way, if the test fails for Design Type or Complexity, it never checks the validity of the Person Field. 


Badge +16

did ‌ solution work for you?

Badge +3

Yes it did, I had forgot to come back and mark correct. Thanks.

Reply