I have been successful in using custom validation to validate an SSN field or EIN field using the custom validation built into the field control settings ([0-9]{3}-[0-9]{2}-[0-9]{4} or [0-9]{2}-[0-9]{7}) however I have one SLT field that will hold the response for an EIN which may be an SSN OR EIN based on a choice field (Entity Type, choices are "Individual" and "Business").
Based on the choice in the Entity Type field i would like to set the custom validation so that the EIN entered is the appropriate pattern.
How do I write the Custom Validation Formula if it depends on the value in another field?
I have tried several combinations but cannot get the validation to work - the one that made the most sense was:
fn-IfElse(Entity Type == "Individual"), [0-9]{3}-[0-9]{2}-[0-9]{4}, [0-9]{2}-[0-9]{7}
The field cannot be blank and is already mandatory