AnsweredAssumed Answered

XML profile - repeatable field with attribute mapping

Question asked by MartinFilakovsky7421 on Jun 17, 2014
Latest reply on Jun 17, 2014 by Adam Arrowsmith

     I have a request XML message with ONE field "cField" which could have different attribute "name". This field is repeatable. Example:
         <cField name="Test1">Value1</cField>
         <cField name="Test2">Value2</cField>
         <cField name="Test3">Value3</cField>

     I would like to do mapping to have a result like this:

     I tried in the mapping use cusotm scripting where as input I have cField value and his attribute name and have three output test1, test2 and test3. The script looks:
     if(name == 'Test1') {
         test1 = cField
     else if(name == 'Test2') {
         test2 = cField
     else if(name == 'Test3') {
         test3 = cField

     Those three output values I mapped to response XML structure. When I run the test, it will generate three documents instead of one:
     1. <response>
     2. <response>
     3. <response>

     Is it possible to have mapping for that to have just one document as a result?