Looping through Transactional message

supratim1034

02-07-2020

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?

Accepted Solutions (1)

Accepted Solutions (1)

ramon_bisswange

Employee

02-07-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-l...

 

JavaScript for parsing etc. is not supported in ACS

Answers (0)