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

In contrast to Edit Validate Rules, other validation mechanisms restrict the values users can enter. For example, property types ensure that users enter valid data, and drop-down lists limit input to approved choices. A Date/Time property can be used to ensure that users enter a valid date, while a drop-down list control can restrict users to predefined values.

Pega Platform provides predefined Edit Validate Rules for commonly used patterns. For example, these Rules validate whether property input values match specific formats, such as a Social Security Number (SSN), Taxpayer Identification Number (TIN), or Aadhaar ID. These Edit Validate Rules run on the client side when users move out of the property, such as by pressing the Tab key.

Nota: You can also create custom Edit Validate Rules by using the Java programming language. These Rules run on the server side when users submit the form. Because of the potential to introduce custom Java into an application, Edit validate Rules represent a potential security risk for your application.

Edit Validate Rules do not restrict the values users enter. Instead, they are defined on properties and validate the format of the data entered by the user. 

Edit Validate Rules normally run immediately when a user changes the value of a field, such as when the user tabs out of the field, because they are designed to validate the format of property values during user input. In contrast, a Validate Rule runs during processing, such as when a user submits a form. When you configure a Validate Rule to call one or more Edit Validate Rules, you defer field‑level validation until form submission. In this scenario, the Edit Validate Rules continue to validate the field’s data format, but they run at submission time rather than at data entry time, based on where the validation logic is invoked.

Nota: For more information on Validate Rules and Edit Validate Rules, see Restricting user input in a field and About Edit Validate Rules.

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.

Este conteúdo foi útil?

Quer nos ajudar a melhorar esse conteúdo?

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