How to Loop Through a PageList in a Correspondence Rule in Pega
In Pega, Correspondence rules are primarily used to generate and send emails, SMS, or printed letters. Often, while constructing correspondence, you may need to loop through a PageList to generate content dynamically. This article explains how to efficiently loop through a PageList in a Correspondence rule using the "forEach JavaServer Page tag".
What is a PageList in Pega?
A PageList in Pega is a clipboard property used to hold a collection of items, where each item is an instance of a data type or class. For example, in the context of a purchase scenario, a PageList named PurchaseList can store the details of multiple purchased products. Each entry in the PageList represents one product and contains properties such as the Product Name, Quantity, and Price.
Use Case Example
Imagine you're building an application where you need to email a client, listing all the purchased products. The product details are stored in a PageList property called PurchaseList.
领英推荐
Example Configuration
Below is a sample structure for an email correspondence rule:
Hello <pega:reference name=".CustomerName" />,
Here are the details of your recent purchases:
<TABLE border="1" cellpadding="5" cellspacing="0">
<TR>
<TH>Product Name</TH>
<TH>Quantity</TH>
<TH>Price</TH>
</TR>
<pega:forEach name=".PurchaseList">
<TR>
<TD><pega:reference name="$THIS.Name" /></TD>
<TD><pega:reference name="$THIS.Quantity" /></TD>
<TD>$<pega:reference name="$THIS.Price" /></TD>
</TR>
</pega:forEach>
</TABLE>
Thank you for your purchase!
Best Regards,
Your Company
Example Output for the PageList:
If the PurchaseList contains the following data:
Coverage Review Determination (CRD) Specialist | Lead Pega Solutions Consultant at Evernorth Health services -Express scripts/The Cigna Group
2 个月Useful tips
Pega Lead System Architect
3 个月Found my article back, this can be utilized in section too https://support.pega.com/discussion/embedding-pagelist-sections-using-jsp-tag-manual-generated-section
Pega Constellation | Pega Infinity | CRM | CSA |CSSA|Ex Pegasystems | Andhra University Alumnus
3 个月Useful tips
?? Software Engineer | Pega Certified Senior System Architect | AI & Automation | Java | React | Cloud & DevOps | Digital Transformation Expert | Azure
3 个月Very informative & eagerly waiting for this kind of knowledge sharing by you...!!!
Software Engineer at virtusa | Pega CSSA | Pega CSA
3 个月Very informative ??