0

I need to be able to pull this data out and display it in the email content. My understanding is that I need to use BuildRowsetFromXML to parse the XML.

   <Details>
      <Detail>
        <Status>Current</Status>
        <Membership>Gold</Membership>
      </Detail>
   </Details> 
5
  • Sorry but i dont understand this question. You need to add more details. If you just want to pull that data out of a dataextension than just store it inside there and request it. If its part of a bigger xml you would need to parse with the tools of your choice. Jul 9, 2019 at 6:15
  • I updated my question, I believe that I need to use BuildRowsetFromXML not Ampscript for this example.
    – Anthony_Z
    Jul 9, 2019 at 12:49
  • you need parse the above xml code ?
    – Ravi.A
    Jul 9, 2019 at 14:22
  • I still to see a question in there. But to parse XML you can either use the AMPscript function BuildRowsetFromXML or you can use GTL (Guide Template Language).
    – DonL
    Jul 9, 2019 at 16:04
  • I need to know how to display the above content inside <Details> in the email content using BuildRowsetFromXML. It's stored in a data extension getting passed to SF from an API push. The column in the DE is called DataStatus.
    – Anthony_Z
    Jul 9, 2019 at 16:12

1 Answer 1

1
%%[
/* Replace this with your DE lookup */
SET @xml = "<Details><Detail><Status>Current</Status><Membership>Gold</Membership></Detail></Details>"

set @status = Field(Row(BuildRowsetFromXML(@xml,"/Details/Detail/Status"), 1), 'Value')
set @membership = Field(Row(BuildRowsetFromXML(@xml,"/Details/Detail/Membership"), 1), 'Value')
]%%
<table>
  <tr>
    <td>Status:</td><td>%%=v(@status)=%%</td>
  </tr>
  <tr>
    <td>Membership:</td><td>%%=v(@membership)=%%</td>
  </tr>
</table>

Not the answer you're looking for? Browse other questions tagged .