Quantcast
Channel: How to pull child content using AMPscript from XML variable - Salesforce Stack Exchange
Viewing all articles
Browse latest Browse all 2

How to pull child content using AMPscript from XML variable

$
0
0

We are using a ET data extension where one of the fields stores an XML file from our external API. We have to extract the values and parse them to assign for each parent/child contained within the variable. How can we build the rowset for each parent and child while continuing to loop through each value? Here's the file structure and current build:

DECLARE @xml xmlSET @xml ='<Schema><Message><HOH><HOHID>49</HOHID><LastName>Jones</LastName><FirstName>William</FirstName><ContactType>EMAIL</ContactType><ContactValue>email@email.com</ContactValue></HOH><Patient><PatientId>55</PatientId><LastName>Jones</LastName><FirstName>Samuel</FirstName><AppointmentDateTime>12/5/2014 10:00:00</AppointmentDateTime><ClinicId>41</ClinicId><AppointmentTypeCode>1</AppointmentTypeCode><AppointmentSubTypeCode></AppointmentSubTypeCode></Patient><Patient><PatientId>66</PatientId><LastName>Jones</LastName><FirstName>Allison</FirstName><AppointmentDateTime>12/5/2014 10:45:00</AppointmentDateTime><ClinicId>41</ClinicId><AppointmentTypeCode>1</AppointmentTypeCode><AppointmentSubTypeCode></AppointmentSubTypeCode></Patient></Message>

 set @rowset = BuildRowsetFromXml(@xml, "//HOH", 1) set @HOHId = Field(Row(@rowset, 1), 'HOHID')

Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>