Need a some help on below expressions with loop | Community
Skip to main content
veerareddyc1015
Level 3
February 6, 2026
Question

Need a some help on below expressions with loop

  • February 6, 2026
  • 1 reply
  • 15 views

Hi All, I need a some help on reading the below rtevent expressions and put it in table format using while  loop or for loop,


<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:nms:rtEvent">
 <soapenv:Header/>
 <soapenv:Body>
  <urn:PushEvent>
   <urn:sessiontoken>?</urn:sessiontoken>
   <urn:domEvent>
    <rtEventtype="Welcome_N" email="veera@gmail.com" wishedChannel="email">
    <ctx>

<schedulePaymentData>

<schedule>
        <schedulePaymentDate> 03/03/2026 </schedulePaymentDate> 
        <schedulePaymentAmount> 599.34 </schedulePaymentAmount>
</schedule>

<schedule>
        <schedulePaymentDate> 03/04/2026 </schedulePaymentDate> 
        <schedulePaymentAmount> 499.34 </schedulePaymentAmount>
</schedule>

<schedule>
        <schedulePaymentDate> 03/05/2026 </schedulePaymentDate> 
        <schedulePaymentAmount> 399.34 </schedulePaymentAmount>
</schedule>

<schedule>
        <schedulePaymentDate> 03/06/2026 </schedulePaymentDate> 
        <schedulePaymentAmount> 299.34 </schedulePaymentAmount>
</schedule>
</schedulePaymentData>
    </ctx>
    </rtEvent>
   </urn:domEvent>
  </urn:PushEvent>
 </soapenv:Body>
</soapenv:Envelope>

give me the for/while loop code to read the above soap in Adobe Campaign Classic v8 javascript variables for AEM rte component and rtevent expressions in AEM

1 reply

Craig_Thonis
Adobe Employee
Adobe Employee
February 6, 2026

Hi Veerareddy,

There are several options, but I’ll list the most common approaches:

Below is a typical personalization block you can drop into the HTML of your transactional template (or a shared JS code used by templates). It assumes the SOAP payload you showed is stored as-is under rtEvent.ctx:

<ctx>
<schedulePaymentData>
<schedule>...</schedule>
<schedule>...</schedule>
...
</schedulePaymentData>
</ctx>

In ACC v8, you can use the Campaign-specific for each loop (E4X) directly on the XML collection.

<table border="1" cellpadding="4" cellspacing="0">
<tr>
<th>Payment date</th>
<th>Payment amount</th>
</tr>

<%
// rtEvent is injected automatically in Message Center templates
// rtEvent.ctx is the XML payload from your SOAP <ctx> element

// This returns all <schedule> child nodes
var schedules = rtEvent.ctx.schedulePaymentData.schedule;

// Campaign-specific E4X loop over XML collection
for each (var s in schedules) {
// Extract and normalize the values as strings
var payDate = String(s.schedulePaymentDate).trim();
var payAmount = String(s.schedulePaymentAmount).trim();
%>
<tr>
<td><%= payDate %></td>
<td><%= payAmount %></td>
</tr>
<%
}
%>
</table>


Additional resources:
Event description
Understand event description
How to make PushEvent and PushEvents SOAP calls | ACC

Regards,

Craig