Salesforce

Append Data Rules (Magic xpi 4.13)

« Go Back

Information

 
Created BySalesforce Service User
Approval Process StatusPublished
Objective
Description

Append Data Rules (Magic xpi 4.13)

The Append Data property in the Data Mapper’s Destination XML allows you to append data to the file.

Let’s understand how the append operation works in the Data Mapper. You can see a sample XML file below where Region Japan has Company IBM element in it. Company IBM has products in it.

Now you want to append Company MSE and its products to the Region Japan. To do this, you may do the mapping in the Studio similar to what is shown below:

Here, the destination XML contains Regions as root element and has Region element in it. The Region has multi-instance Company elements inside it. You want to append data to the last instance of the Company compound elements in the Region.

While doing the mappings, consider the following rules on which the Append Data operation in the Data Mapper works:

  • The mapped multi-instance compound (complex element) which is nearest to the root will be considered for the append operation. The append will iterate based on the rows in the source data.

  • Any mapped values outside the scope of the above branch will be considered for creation only i.e. the element and its value will be added only if does not already exist in the destination XML.

  • The append operation will be done to the last instance of the immediate parent. In the example given below, it will be Company MSE entry in the XML.

  • The append operation will be done to the parent compound and it's direct non-compound children only if the parent compound has a mapping.

In the given example, the append operation will be done to the MSE Company element as that is the last instance of the immediate parent, Japan.

After the append operation is done the resultant XML will look like below:

Reference
Attachment 
Attachment