Validate SSN

How to validate ssn in appian? format should be ###-##-####

  Discussion posts and replies are publicly visible

Parents Reply
  • +1
    Certified Lead Developer
    in reply to Chaitra R

    Second, "regexMatch" expects at least 2 parameters, pattern then search string.  You're only passing in the pattern, and then your search string is not even included in the function call.

    The correction to this is fairly simple:

    regexmatch(
      "^\d{3}-\d{2}-\d{4}$",
      ri!ssn
    )

    ...which seems to work fine per what you're after.   Please note also that "regexMatch()" returns values of TRUE or FALSE, so you'll want to only show your validation message when the match operation returns a FALSE.

    (When you have this part down, I'd note that there are some heuristic validations for SSN's which you might want to eventually include - such as, no section of the SSN is allowed to be all zeros, the first digit can't be "9", etc.)

    2/2

Children