FAQ KB0404123
Email
How can I set up a validation for the Postal Code field in an Address question?
Question

I need suppliers / internal users to not put invalid values in the Postal Code field of the Address questions.
Is there a way to set up a validation for this field, so the system does not accept invalid values?

Answer

Follow these steps to do this:

  1. Go to Manage > Administration > Data Import/Export > Export, search for Country-Specific Postal Code Validations, then click the Export button.
  2. Open the file with a text editor, and set the regular expression / regex you want (on the internet there are sites explaining how to create these expressions) to validate the format of the accepted values for the Postal Code field.
    1. This expression must be entered in the fifth column in the file: you can use the first line in the file/the header to guide you.
    2. This must be done for each country separately; as you can see in the file, there's a specific line for each one of them.
    3. Make sure to use an expression to make it so the field accepts only 10 characters maximum.

Here is an example of file with custom postal validation for some countries:

Country,CountryCode,ISO,Note,Regex,ZipFormat
"Moldova","MD","MD",,"^(^MD\d{4})$|^(MD-\d{4}$)$","CCNNNN, CC-NNNN"
"Falkland Islands","FK","FK",,"^(^FIQQ\s1ZZ$)$","FIQQ 1ZZ"
"Montserrat","MS","MS",,"^[Mm][Ss][Rr]\s{0,1}\d{4}$","MSR 1110-1350"
"Singapore","SG","SG",,"^(^\d{6}$)$","NNNNNN"

Additional Information

Refer Defining country/region-specific postal code validation for supplier addresses for more details.


Applies To

Supplier Lifecycle & Performance

Terms of Use  |  Copyright  |  Security Disclosure  |  Privacy