AnsweredAssumed Answered

How to map multiple elements from Salesforce to single element in XML

Question asked by jaya.patil345621 on May 2, 2017
Latest reply on May 4, 2017 by apatel@diligent.com

I am trying to generate XML file from Salesforce. 

 

Product Object - For each product i would be getting below elements ( can be imagined as a single row)

 

Elements

Name

Height

Width

Color

 

For instance

Chair

6

2

Blue

 

Required Output format in XML

 

<Product>

  <Name> Chair</Name>

            <Attributes>

            <Attribute><Name>Height</Name><Value>6</Value>

            <Attribute><Name>Weight</Name><Value>2</Value>

            <Attribute><Name>Color</Name><Value>Blue</Value>

            </Attributes>  

</Product>

Outcomes