Many to one mapping

Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Many to one mapping

Viewing 1 reply thread
  • Author
    Posts
    • #20036

      Hi

      I have the need to map the distinct values from a repeating record in the source to the destination

      My source has a repeating node and has a child element “CodeName” with the required value .

      Say …………
      If the CodeName value “ABC” exists and is repeated 6 times in the child
      element or CodeName value “XYZ” exists and is repeated 2 times
      the destination should node should contain “ABC” and/or “XYZ” only once.

      How do i achieve that ?

      -Jerry

    • #20037

      Can u Send the Input and expected output schema sample.

      • #20054

        The node in question is the Authors node in O/p xml ……. the Record->Author node in i/p is mapped to Authors->Author of o/p

        even though the record –>Author value repeats in i/p it appears only once in Authors–> Author

        I/p

        <ns0:LibraryData LibraryName=”LibraryName_0″ xmlns:ns0=”http://Library.Books.Schemas.LibraryData”&gt;
          <ns0:Record>
            <ns0:Title>ABC</ns0:Title>
            <ns0:Author>JOHN</ns0:Author>
            <ns0:ISBN>123234123123</ns0:ISBN>
            <ns0:CheckOutDate>CheckOutDate_0</ns0:CheckOutDate>
          </ns0:Record>
          <ns0:Record>
            <ns0:Title>XYZ</ns0:Title>
            <ns0:Author>JOHN</ns0:Author>
            <ns0:ISBN>5435345123</ns0:ISBN>
            <ns0:CheckOutDate>CheckOutDate_0</ns0:CheckOutDate>
          </ns0:Record>
          <ns0:Record>
            <ns0:Title>HIJ</ns0:Title>
            <ns0:Author>BOB</ns0:Author>
            <ns0:ISBN>65445435123</ns0:ISBN>
            <ns0:CheckOutDate>CheckOutDate_0</ns0:CheckOutDate>
          </ns0:Record>
          <ns0:Record>
            <ns0:Title>SWT</ns0:Title>
            <ns0:Author>JOHN</ns0:Author>
            <ns0:ISBN>65445435128</ns0:ISBN>
            <ns0:CheckOutDate>CheckOutDate_0</ns0:CheckOutDate>
          </ns0:Record>
          <ns0:Record>
            <ns0:Title>LMN</ns0:Title>
            <ns0:Author>BOB</ns0:Author>
            <ns0:ISBN>65445435124</ns0:ISBN>
            <ns0:CheckOutDate>CheckOutDate_0</ns0:CheckOutDate>
          </ns0:Record>
        </ns0:LibraryData>

         

        O/P

        <ns0:ExportList xmlns:ns0=”http://Library.Books.Schemas.ExportList”&gt;
          <ns0:BatchData ns0:BatchIdentifier=”BatchIdentifier_0″>
            <ns0:Authors>
              <ns0:Author>
                <ns0:Name>JOHN</ns0:Name>
                <ns0:Code>Code_0</ns0:Code>
              </ns0:Author>
              <ns0:Author>
                <ns0:Name>BOB</ns0:Name>
                <ns0:Code>Code_1</ns0:Code>
              </ns0:Author>
            </ns0:Authors>
            <ns0:BookRecords>
              <ns0:Book>
                <ns0:Title>ABC</ns0:Title>
                <ns0:ISBN>123234123123</ns0:ISBN>
                <ns0:LastUsedDate>CheckOutDate_0</ns0:LastUsedDate>
              </ns0:Book>
              <ns0:Book>
                <ns0:Title>XYZ</ns0:Title>
                <ns0:ISBN>5435345123</ns0:ISBN>
                <ns0:LastUsedDate>CheckOutDate_0</ns0:LastUsedDate>
              </ns0:Book>
              <ns0:Book>
                <ns0:Title>HIJ</ns0:Title>
                <ns0:ISBN>65445435123</ns0:ISBN>
                <ns0:LastUsedDate>CheckOutDate_0</ns0:LastUsedDate>
              </ns0:Book>
              <ns0:Book>
                <ns0:Title>SWT</ns0:Title>
                <ns0:ISBN>65445435128</ns0:ISBN>
                <ns0:LastUsedDate>CheckOutDate_0</ns0:LastUsedDate>
              </ns0:Book>
              <ns0:Book>
                <ns0:Title>LMN</ns0:Title>
                <ns0:ISBN>65445435124</ns0:ISBN>
                <ns0:LastUsedDate>CheckOutDate_0</ns0:LastUsedDate>
              </ns0:Book>
            </ns0:BookRecords>
          </ns0:BatchData>
        </ns0:ExportList>

         

        -Jerry

        • #20062

          I haven’t got it right yet. Please see below whether it is what you are expecting ?

           

          I haven’t got it right yet. Please see below whether it is what you are expecting ?

          i/p

           <ns0:Record>
              <ns0:Title>ABC</ns0:Title>
              <ns0:Author>JOHN</ns0:Author>
              <ns0:ISBN>123234123123</ns0:ISBN>
              <ns0:CheckOutDate>CheckOutDate_0</ns0:CheckOutDate>
            </ns0:Record>
            <ns0:Record>
              <ns0:Title>XYZ</ns0:Title>
              <ns0:Author>JOHN</ns0:Author>
              <ns0:ISBN>5435345123</ns0:ISBN>
              <ns0:CheckOutDate>CheckOutDate_0</ns0:CheckOutDate>
            </ns0:Record>

           

          o/p expected

           

           <ns0:Authors>
                <ns0:Author name=”john” code=”code_0″>
                <ns0:Author name=”Bob” code=”code_1″>

          </ns0:Authors>

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.