Discussion

Pegasystems Inc.
BR
Last activity: 12 Sep 2025 16:01 EDT
How to Validate a Page List in Constellation
Introduction
In application development, ensuring data integrity is paramount. When dealing with lists of data, such as a list of products in an e-commerce application, robust validation mechanisms are crucial to prevent incorrect or incomplete data from being processed. Constellation, a powerful platform for building enterprise applications, provides comprehensive tools to implement such validations. This guide will walk you through the process of validating a page list in Constellation, ensuring that each item within the list adheres to predefined rules before submission. By following these steps, you can significantly enhance the reliability and user experience of your applications, safeguarding against common data entry errors and maintaining high data quality.
Step-by-Step Instructions
Follow these steps to implement page list validation in Constellation:
1. Define the Page List Field
First, ensure your case type includes a page list field. This field will hold the collection of data you intend to validate.
As shown in the image above, the Products field is defined as Embedded Data with a Data object of Product and selected as List of records. This configuration allows the field to store multiple instances of the Product data type.
2. Configure the Page List Columns
Next, configure the columns for your page list. These columns represent the individual properties of each item within the list that will be subject to validation.
The Products field, when edited, reveals its constituent columns: Name, Category, CostPrice, ListPrice, and Description. These are the properties that will be validated for each product entry.
3. Integrate the Page List into the UI
Integrate the page list into your user interface (UI) to allow users to input data. This typically involves adding the page list field to a section or view.
Here, the Products field is added to the Collect information view, making it visible and editable for the end-user.
4. Configure the Flow Action
Set up a flow action to handle the submission of the form containing your page list. This action will trigger the validation process.
The CollectInformation flow action is configured to process the data submitted from the form.
5. Link Flow Action to View
Ensure the flow action is correctly linked to the view containing your page list. This establishes the connection between the UI and the backend processing.
The CollectInformation view is associated with the CollectInformation flow action, ensuring that data entered in the UI is passed to the correct processing logic.
6. Apply Validation to Flow Action
Attach a validation rule to your flow action. This rule will be executed when the form is submitted.
The ValProductRegistration validation rule is applied to the flow action, indicating that this rule will be invoked to validate the submitted data.
7. Define Page List Validation Rule
Create a validation rule specifically for your page list. This rule will iterate through each item in the list and apply further validations.
Note: this rule is create in the MyAPP-Work-SampleFormValidation class
The ValProductRegistration rule calls ValProductInformation for each item in the Products() page list. This ensures that every product entry is individually validated.
8. Implement Item-Level Validation
Finally, define the specific validation logic for each item within the page list. This is where you set the conditions that each item must meet.
Note: This validation rule is in the MyAPP-Data-Product class, not on the work class.
The ValProductInformation rule includes two conditions: ListPrice must be greater than CostPrice, and Description must have more than 5 characters. If these conditions are not met, appropriate error messages are displayed.
9. Test the Validation
Test the implemented validation by entering data that violates the defined rules.
In this example, the Description for 'Laptop' is 'Work' (less than 5 characters), and the ListPrice for 'GoT' is equal to CostPrice (not greater).
Upon submission, the system displays error messages indicating the validation failures.
Clicking on the 'Laptop' item reveals the specific error: "The description must have more than 5 character."
Clicking on the 'GoT' item shows its specific error: "The list price has to be greater than the cost price."
10. Correct and Re-test
Correct the invalid data and re-submit to ensure the validation passes.
After correcting the Description for 'Laptop' to 'Work great' and ListPrice for 'GoT' to '$201.00', the form can be successfully submitted.
The form now submits without validation errors, confirming the successful implementation of the page list validation.
Conclusion
Implementing robust validation for page lists in Constellation is crucial for maintaining data quality and enhancing user experience. By carefully defining page list fields, configuring columns, integrating them into the UI, and applying comprehensive validation rules at both the flow action and item-specific levels, developers can ensure that all data entered into their applications meets the required standards.
This systematic approach not only prevents errors but also streamlines the data entry process, leading to more reliable and efficient applications. The ability to define granular validation rules, such as checking price relationships or text length, provides the flexibility needed to address diverse business requirements effectively. Ultimately, a well-validated page list contributes significantly to the overall integrity and usability of any Constellation-built application.
References
Core Constellation Documentation
- Center-out configuration in Constellation - Comprehensive guide to Constellation's low-code approach and configuration principles
- Constellation UI - Overview of Constellation architecture and design system
- Working with Constellation - Development journey and best practices for Constellation applications
Form and Field Validation
- Validating input values on a form - Essential guide for implementing form validation in Constellation
- Establishing data validations - Comprehensive coverage of validation activities and validate rules
- Best practices for accessibility in Constellation - Includes guidance on meaningful error messages and validation
Page List and Data Object Configuration
- Data objects overview - Foundation concepts for data objects used in page lists
- Building data objects by connecting to an OData system of record - Advanced data object configuration and integration
- Best practices for Constellation tables - Guidelines for working with list data and tables in Constellation
Flow Actions and Processing
- Flow Actions - Complete documentation on flow action configuration and validation integration
- Migrating Flow Actions - Guidelines for aligning flow actions with current page context
Pega Academy Learning Resources
- Configuring Constellation applications - Comprehensive Academy module covering application configuration
- Modeling data in Constellation applications - Data modeling best practices and techniques
- Designing forms in Constellation - Form design principles and validation implementation
- Constellation and the Data Model - Understanding the relationship between data models and UI components
- Configuring page, page group, and page list properties - Specific guidance on page list property configuration
- Best practices of the Pega Constellation design system - Design system standards and validation best practices
Additional Resources for Advanced Implementation
- Creating list views for externally-sourced data in Constellation user interface - Advanced list view configuration techniques
- Other resources for Constellation - Additional community resources and learning materials