How to validate embedded Page List properties and control entry count in Pega Constellation?

In a Pega Constellation application, I need to implement the following functionality for collecting account numbers from users. Could anyone please advise on the best way to design this?

  • User must enter a minimum of 1 account number, with a maximum of 50 account numbers.
  • Plus+ icon appears below the account list. Clicking the icon adds another account
  • User has the option to remove
  • For each account, the user must enter the following
  • Text input box that supports the format (16n)
  • Error message if empty or misformatted: “16-digit account number is required”

@AchinthaJ

Use a Page List property Accounts and show it with a Constellation List/Repeating view; initialize one blank row in a pre-load data transform so the user always starts with 1 entry. Add an Add item action (Plus icon) and set a Disable when on that control like sizeOfPageList(.Accounts) >= 50 so users can’t add more than 50. Add a Delete item row action and hide/disable it when sizeOfPageList(.Accounts) = 1 so at least one account stays. For the field, use a Text input with an input mask/pattern 16n (or an Edit Validate using regex ^\d{16}$) and mark it Required. Show a custom message “16-digit account number is required” on fail (client message) and back it up with a server-side Validate rule. In the Validate rule, check both the overall count (1–50) and per-row format; loop over Each page in .Accounts and add a message on .AccountNumber when empty or not 16 digits. Reference this Validate rule on the step or view’s Submission validation so errors surface inline. Optionally add helper text under the field and a counter like “X of 50 added” using a read-only text bound to sizeOfPageList(.Accounts).

Thank you @Sairohith