Home Page › Forums › BizTalk 2004 – BizTalk 2010 › how can I map multiple records to a single record?
- This topic has 5 replies, 1 voice, and was last updated 6 years, 10 months ago by
community-content.
-
AuthorPosts
-
-
May 12, 2006 at 4:51 PM #14659
I have a source schema with multiple records(but not the same structure), need to map the fields in these records to a single record, could anybody give me some idea how to do that? I try to use looping functoid but it seems only for multiple repeat records with the same structure.
-
May 15, 2006 at 9:24 PM #14660
Thank you Stephen.
I saw your blog, still have problem
here is the map I need to make:Source Destination
Root Root
Record1 Record
item1 ————> item_a
item2 ————> item_b
Record2
item3 ————> item_d
item4 ————> item_e
item5 ————> item_f
Record3
item6 ————> item_gis looping functoid only for multiple source records that have same structure?
-
May 16, 2006 at 2:08 PM #14661
Stephen, I did try it without functoid, only output the two items in the first record, all the others are missing……I set them to unbounded, wondering what’s wrong
-
May 15, 2006 at 6:46 PM #14662
Can you just use a simple String Concatenation Functoid?
You might also want to look at one of my past blog postings: http://geekswithblogs.net/sthomas/archive/2004/10/28/13982.aspx
Not sure if it will really help or not through.
-
May 15, 2006 at 10:54 PM #14663
This doesn’t look like you’d need the looping functoid.
Have you tried it without it?
-
May 25, 2006 at 5:37 PM #14664
I can’t tell whats really going on, without a schema and samples, but if I take your subject line literally, you may need to use the more obscure features of the looping functoid.
Say you have in your source schema a repeating set, but in your destination schema you want it to flatten out… say maybe a repeating <Ph_Number> element in the source schema and a <myphnum1>, <myphnum2> and <myphnum3> element in the destination schema…
Here’s your source:
<loop>
<Ph_Number>1234567</Ph_Number>
<Ph_Number>1212123</Ph_Number>
<Ph_Number>9999999</Ph_Number>
</loop>And here’s what you want the destination to be:
<myphnum1>1234567</myphnum1>
<myphnum2>1212123</myphnum2>
<myphnum3>9999999</myphnum3>The trick is to tie the looping functoid to the loop on the source (in my example, the <Ph_Number> element), and connect it THREE TIMES to the destination… once to myphnum1, once to myphnum2, and once to myphnum3.
Then you can use the Iteration Functoid (tied to the <Ph_Number> element) to get whether you’re looking at the first, second, or third <Ph_Number>. Run the Iteration output to 3 different ‘=’ functoids. Each of the ‘=’ functoids will compare the iteration to a 1, 2, or 3 respectively. Wire the three ‘=’ functoids to three value-mapper-flatteners. Also wire the <Ph_Number> element to each of the three value-mapper-flatteners. Then wire the value-mapper-flatteners to <myphnum1>,<myphnum2>, and <myphnum3> elements respectively in the destination schema.
I have this in a diagram that I use when I teach BizTalk… so I can send it to you if you email me. (find me in the Memberlist).
Anyway, the obscure trick to this is that the looping functoid will walk the multiple records in the source schema as many times as its wired to non-repeating elements in the destination schema! Then all you have to do is add enough logic to figure out which record will go to which element… in my example I just used the iteration functoid.
-
-
-
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.