When mapping values and fields in a custom XML outbound integration, use “dot notation” to define where each value being mapped should be placed in the request body.
(This article assumes that you understand the basics of how XML documents are structured. There are numerous resources and tutorials online that cover the basics of XML data structures.)
XML documents consist of hierarchically organized sets of tagged values. Use dot notation to map the structural path to each value you need to send to the recipient of your LeadConduit flow’s Custom XML outbound step.
It’s probably easiest to see how dot notation works by looking at an example. Here’s a typical XML request body:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<lead>
<Acode>D80731</Acode>
<FirstName>**first_name**</FirstName>
<LastName>**last_name**</LastName>
<HSGraduationYear>** graduation_year **</HSGraduationYear>
</lead>
<phones>
<PhoneNumber>**phone_1**</PhoneNumber>
<PhoneType>3</PhoneType>
</phones>
<phones>
<PhoneNumber>**phone_2**</PhoneNumber>
<PhoneType>1</PhoneType>
</phones>
<leadEmail>**email**</leadEmail>
<address>
<Line1>**address_1**</Line1>
<City>**city**</City>
<State>**state**</State>
<Country>US</Country>
<Zip>**postal_code**</Zip>
</address>
<passcode>cjdujwofpf</passcode>
<programTypeCode>**program_of_interest**</programTypeCode>
</root>
Note that it consists of a root object
To map a value to a simple object like
When there are multiple instances of same-named objects inside the same wrappers, such as
Here is an example of what the mappings for the above XML request body would look like in LeadConduit:
XML attributes are mapped using an “@” before the attribute name. Here’s what the
<phones>
<PhoneNumber PhoneType="3">**phone_1**</PhoneNumber>
</phones>
<phones>
<PhoneNumber PhoneType="1">**phone_2**</PhoneNumber
</phones>
And here is how that section would be mapped:
What if you need to send an an array of same-named XML properties that are distinguished by their attributes? For example:
Simply add .#text onto the end of the value mapping. Add a period after the array number in the attribute mapping. So here is how the above sample XML request would be mapped:
Wrapping XML data in <![CDATA ]]> Tags
<![CDATA[ ]]> tags are supported by putting #cdata at the end of the mapping’s XMLpath.
For example, These mappings produce a plain XML request body:
Adding #cdata to the mapping wraps the data in <![CDATA[ ]]> tags:
- mapping_values_to_a_custom_xml_outbound_01.png40 KB
- XML_arr_example_req.png50 KB
- plain_xpath_mappings.jpg40 KB
- plain_xpath_request.jpg30 KB
- cdata_xpath_mappings.jpg40 KB
- cdata_xpath_request.jpg30 KB
- mapping_values_to_a_custom_xml_outbound_03.png600 KB
- mapping_values_to_a_custom_xml_outbound_02.png2 MB
- XML_arr_example.png600 KB
Comments
0 comments
Please sign in to leave a comment.