1

I've been asked to incorporate a new dynamic section into one of our emails. This section will display if someone opts for premium connection service with the product. If they do, the IsPremium flag in the XML will be set to true and if they don't or they choose a normal connection service it will show up false.

I've found that if someone adds more than one product to the basket (choosing normal connection service for the first product and then a premium connection service for the second product), the content won't display. I think this may be because the amp script logic I've used only looks at the first IsPremium flag.

I was just wondering if there's a way to loop through flags in an XML file using AMPScript?

Thanks in advance.

  • Have you been able to get this working? If so make sure to mark your question as answered, otherwise we can help you get it working. – Kelly J Andrews Feb 19 '14 at 2:36
0

As long as the XML provided is for an individual subscriber, you can do something like this:

Given the @xml variable contains the following text:

<root>
        <Flight origin="IND" dest="NYC">100.00</Flight>
        <Flight origin="IND" dest="LAX" carrier="UAL">200.00</Flight>
        <Flight origin="IND" dest="SEA">500<PerBagSurcharge>25</PerBagSurcharge></Flight>
</root>

Using the following function call:

BuildRowsetFromXml(@xml, "//Flight", 1)

Documentation is located here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.