Expand my Community achievements bar.

SOLVED

Looping through Transactional message

Avatar

Level 2

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?
1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

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

View solution in original post

8 Replies

Avatar

Correct answer by
Employee Advisor

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

Avatar

Level 2
I am using this looping inside a content block. Content block supports such basic building blocks and b

Avatar

Employee Advisor
yes, content block can do it but it's not officially documented so product support won't help you on any issues.

Avatar

Level 2
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!!

Avatar

Level 2
We have the same issue: we move looping in content block, but it is no working. We are not sure that the standard product listing covers all our needs. This is quite disappointing and is giving us a lot of troubles with our customer.

Avatar

Level 2

No, we did not find a solution. We cannot use the product listing feature neither looping in a content block so we had to replicate the product list it in every template (and we have a lot of templates that list product, it is a maintenance nightmare). The Javascript support in ACS is poor, not documented at all and unreliable, we have to perform a lot of try-and-error development. Very disappointing.