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
  • 4264 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

Level 2
July 29, 2021
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.
Level 2
August 13, 2022

Hello @fabiosurini , did you find any solution for this issue? We are having the same problem (https://experienceleaguecommunities.adobe.com/t5/adobe-campaign-standard/target-more-than-one-profile-in-transactional-messages-adobe/m-p/540294). Thank you!


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.