Discussion

Pegasystems Inc.
CA
Last activity: 14 Jun 2025 7:25 EDT
Constellation - Automatically Populating Default Values When Adding New Rows to Embedded Data (PageList)
Use Case Description: In many business scenarios, users are required to add multiple records for a specific entity within a form, such as entering multiple addresses, contacts, or line items. To streamline data entry and enhance user experience, it is often necessary to pre-populate certain fields in each new row with default values or calculated data based on business rules.
Implementation Steps:
Step 1: Define Default Values Using a Data Transform
- In the data class associated with your Embedded Data Property (PageList), create a new Data Transform named pyDefault
- Within this Data Transform, specify the data elements and their default values that should be automatically populated whenever a new row is added. Configure these values according to your business requirements. For example:
- Set a default status (e.g., "Active")
- Populate the current date
- Retrieve a user’s department from the parent case
Step 2: Configure the View to Use the Data Transform
- Open the relevant View (section) where users will add embedded data.
- Add the Embedded Data Property (PageList) to this View.
- Click the gear icon next to the embedded list property to configure its settings.
- Set the "Visibility condition" to use a When rule, and select the "Always" condition to ensure the add row functionality is always available.
Step 3: Define the Declare Expression to Prepopulate Data Based on Business Rules
- Create a Declare Expression for the property in the Data layer.
- Add the specific business rule for the property to dynamically prepopulate the data based on the data entry on other fields.
Step 4: Test the Functionality
- Launch the application and navigate to the section containing the Embedded Data (PageList).
- Click "Add row" to add a new record.
- Observe that the fields in the newly added row are automatically populated with the default values specified in your pyDefault Data Transform.