How to validate ssn in appian? format should be ###-##-####
Discussion posts and replies are publicly visible
I think this would be a good case for the regular expression plugin.
can we use regex in a!textfield()
You can use regex pattern matching in any place you'd use other expression logic. In this case, Stefan is referring to using it in the text field's "validations" parameter.
i am creating a form. user needs to fill the ssn field. if he enters other than this ###-##-####, it should throw validation message.
i am not sure, but am using like this:
validations: {regexmatch("^\d{3}-\d{2}-\d{4}$"),ri!SR_Test.ssn}
its showing an error "Unexpected number of parameters"
Your expression is not formatted correctly.
First, "validations" expects one or more strings. These strings will be shown as [failed] validation message(s) anytime they're present - meaning you would need to show the strings conditionally, something like this:
validations: { if( [validation failure condition #1], "Validation Message 1", {} ), if( [validation failure condition #2], "Validation Message 2", {} ), [etc] }
1/