Stephen Gilmore

Custom Workday address validation

3 weeks ago Workday

We have a vendor in the Netherlands that is quite picky about the address postal code they receive. It must be 1234 AB, not 1234AB or any other kind of thing. The team wanted to see if it was possible to add some kind of validation to make sure the format of the postal code was correct.

After maybe 30 minutes, this is what I came up with.

The picture might be tiny. You can try Right Click + "Open image in new tab"

The way it works is by parsing out each character of the provided postal code and then checking it against a text constant field of allowable alpha or numeric characters. There are also checks that it only applies when the country is in the Netherlands and that the length is exactly 7 characters.

All of the substring text fields for each chatacter are dependent on this evaluate expression calc field:

Getting a single character for any given position looks like this: