Skip to main content

Data validation against a pattern

In Pega Platform™ applications, you use validation to minimize the errors that can occur when users submit erroneous data. For example, during Case processing, users enter their Social Security number (SSN). You want to ensure that users enter an SSN in the correct nine-digit format that is divided by hyphens: 111-11-1111. To achieve this validation, you use an Edit Validate Rule, which is a Rule type that validates character patterns. When users enter an SSN in the wrong format and click away from the field, an error message is displayed, as shown in the following figure:

An edit validate rule applied to the SSN field checks whether the SSN is in the correct format

Other common types of validation restrict the choices available to users. For example, developers can specify a Date/Time property type to ensure that users enter only a valid date or determine that the property uses a drop-down list control to limit users to approved choices. In contrast, Edit Validate Rules do not restrict the values that the users can enter; they validate based on the data format. 

Edit Validate Rules are defined on properties. Edit Validate Rules do not restrict the data values users enter in the property; they validate the format of the data that users enter.

Pega Platform provides predefined Edit Validate Rules for commonly used patterns. For example, Edit Validate Rules validate whether the property input is an SSN, Taxpayer Identification Number (TIN), or Aadhaar ID. These Rules validate on the client side when users use the Tab key to move out of the property.

Developers can also create custom Edit Validate Rules using Java. These Rules validate on the server side when users submit the form.

Caution: Custom Edit Validate Rules use Java, so you require knowledge of Java programming if you want to create your own Edit Validate Rule.

To apply an Edit Validate Rule to a property, reference the Edit Validate Rule on the Advanced tab of the property Rule form in the Use validate field. The following figure shows a property Rule for capturing a postal code, with an Edit Validate Rule applied to verify that entered values match the US ZIP Code format:

A property rule configured to validate that input values conform to the US ZIP Code format for postal codes.
Note: Configure a Validate Rule to call one or more Edit Validate Rules to defer validation of the value of a field. When you call an Edit Validate Rule from a Validate Rule, the system validates the contents of the field when users submit the form rather than when users change the value of the field.

Check your knowledge with the following interaction:


This Topic is available in the following Module:

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice