cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Issue: Repeating Target node based upon source value of another field

Former Member
0 Kudos

Hi Experts,

we have a mapping requirement wherein the target node should be repeated as many as times based upon other source field i.e., <line_number> should be repeated based upon <identification_code> at the target side. whether the same can be achieve via standard function or do we need to create an UDF for the same. Kindly help me in this regard by providing the mapping logic.

Suppose the Source structure is

<INPUT_MESSAGE>
<LINE_NUMBER>1</LINE_NUMBER>
<LINES>
<IDENTIFICATION_CODE>ZA</IDENTIFICATION_CODE>
<ACTIVITY_CODE>001</ACTIVITY_CODE>
<IDENTIFICATION_CODE>FA</IDENTIFICATION_CODE>
<ACTIVITY_CODE>002</ACTIVITY_CODE>
<IDENTIFICATION_CODE>EF</IDENTIFICATION_CODE>
<ACTIVITY_CODE>003</ACTIVITY_CODE>
</LINES>
<LINE_NUMBER>2</LINE_NUMBER>
<LINES>
<IDENTIFICATION_CODE>ZA</IDENTIFICATION_CODE>
<ACTIVITY_CODE>004</ACTIVITY_CODE>
<IDENTIFICATION_CODE>FA</IDENTIFICATION_CODE>
<ACTIVITY_CODE>005</ACTIVITY_CODE>
</LINES>
</MESSAGE>

and the output should be the below one.


<OUTPUT_MESSAGE>
<LINES>
<LINE>
<LINE_NUMBER>1</LINE_NUMBER>
<IDENTIFICATION_CODE>ZA</IDENTIFICATION_CODE>
<ACTIVITY_CODE>001</ACTIVITY_CODE>
</LINE>
<LINE>
<LINE_NUMBER>1</LINE_NUMBER>
<IDENTIFICATION_CODE>FA</IDENTIFICATION_CODE>
<ACTIVITY_CODE>002</ACTIVITY_CODE>
</LINE>
<LINE>
<LINE_NUMBER>1</LINE_NUMBER>
<IDENTIFICATION_CODE>EF</IDENTIFICATION_CODE>
<ACTIVITY_CODE>003</ACTIVITY_CODE>
</LINE>
</LINES>
<LINES>
<LINE>
<LINE_NUMBER>2</LINE_NUMBER>
<IDENTIFICATION_CODE>ZA</IDENTIFICATION_CODE>
<ACTIVITY_CODE>004</ACTIVITY_CODE>
</LINE>
<LINE>
<LINE_NUMBER>2</LINE_NUMBER>
<IDENTIFICATION_CODE>FA</IDENTIFICATION_CODE>
<ACTIVITY_CODE>005</ACTIVITY_CODE>
</LINE>
</LINES>
</OUTPUT_MESSAGE>

your help is highly appreciated

Regards

Faisal

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member190293
Active Contributor
0 Kudos

Hi Abdul!

Your requirement can be easily achieved by using UseOneAsMany standard function in message mapping or using Variable.

Regards, Evgeniy.