Looping through Transactional message | Community
Skip to main content
supratim1034
Level 2
July 2, 2020
Solved

Looping through Transactional message

  • July 2, 2020
  • 1 reply
  • 4271 views

Hi All,

I am using ACS RT transactional message. I have created a collection in the event object. My json of the event looks as following:

{
    "email""a@gmail.com",
    "ctx": {
"ratePlans": [
            {
                "ratePlanCode""string127 #1",
                "taxInclusive"true,
                "startDt""2020-07-02",
                "startDateYYYYMMDD""string127 #1"
            },
            {
                "ratePlanCode""string127 #2",
                "taxInclusive"true,
                "startDt""2020-07-02",
                "startDateYYYYMMDD""string127 #5"
            }
        ]
I am trying to find how to get the array length for looping through the values. context.rtEvent.ctx.ratePans.length is not working. I tried for for each loop, even that is failing and this being an ACS, I cannot see how the final ctx data is getting stored in the table - any thoughts?
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by bisswang

If you want to do a loop, the official way is to use the Product Listings feature:

https://docs.adobe.com/content/help/en/campaign-standard-learn/tutorials/designing-content/product-listings-in-transactional-email.html

 

JavaScript for parsing etc. is not supported in ACS

1 reply

bisswangAdobe EmployeeAccepted solution
Adobe Employee
July 2, 2020

If you want to do a loop, the official way is to use the Product Listings feature:

https://docs.adobe.com/content/help/en/campaign-standard-learn/tutorials/designing-content/product-listings-in-transactional-email.html

 

JavaScript for parsing etc. is not supported in ACS

supratim1034
Level 2
July 22, 2020
I think then this is a very serious problem. I agree that the email content palatte is now a very robust and very much akin to the AEM kind of content builder. But in multiple cases, the email will be built by another tool (outisde of Campaign) and campaign is used mostly for delivery and segmentaition purpose. So not giving developer enough flexibility is an issue!!
Level 2
August 11, 2022