Search code examples
biztalkbiztalk-2013

Mapping a Flat Schema to a Repeating Schema


Biztalk Map

Hi, I'm new to BizTalk. I literally have a single record in the source schema.

<?xml version="1.0" encoding="utf-8"?>
    <LogEntryResponse xmlns="...">
      <LogEntryResult>
        <TxId>string1</TxId>
        <ServiceName>string2</ServiceName>
        <Identifier>string3</Identifier>
        <Amount>string4</Amount>
        <Status>string5</Status>
        <Detail>string6</Detail>
      </LogEntryResult>
    </LogEntryResponse>

I would like use each of the elements to make an individual record in the target schema like so:

<?xml version="1.0" encoding="UTF-8"?>
      <ns1:processRequestResponse>
         <return>
            <name>string1</name>
            <value>string1</value>
         </return>
         <return>
            <name>string2</name>
            <value>string2</value>
         </return>
         <return>
            <name>string3</name>
            <value>string3</value>
         </return>
      </ns1:processRequestResponse>
</ns0:Envelope>

I have tried a number of things but it is clear I am doing something wrong. I hope someone can point me in the right direction.


Solution

  • It should be very simple.

    All you have to do is link TxId, ServiceName, Identifier, etc. all to a Looping Functoid. Then link from the Looping Functoid to Return.

    Then you can link each individual field to Value and use a String Concatenate to set each of the Name fields.