cancel
Showing results for 
Search instead for 
Did you mean: 

Help required on mapping to remove duplicate entries

Former Member
0 Kudos

Hi all experts,

I need some help in mapping. I am new to this tool. How would I remove duplicate entries in source payload? My structure is as follows

Message Structure

<List> 1-1

<ParentNode> 0-unbounded

<Child1> 0-1

<Child2> 0-1

Source:

<List>

<ParentNode>

<Child1>PK1</Child1>

<Child2>SomeValue1</Child2>

</ParentNode>

<ParentNode>

<Child1>PK1</Child1>

<Child2>SomeValue1</Child2>

</ParentNode>

<ParentNode>

<Child1>PK2</Child1>

<Child2>SomeValue2</Child2>

</ParentNode>

</List>

Target I would like:

<List>

<ParentNode>

<Child1>PK1</Child1>

<Child2>SomeValue1</Child2>

</ParentNode>

<ParentNode>

<Child1>PK2</Child1>

<Child2>SomeValue2</Child2>

</ParentNode>

</List>

Any help?

Thanks so much all

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Please try this:

<Child1>-->RemoveContext Node function>Split by Value(set the property as on value change)->CollapseContext---<ParentNode>

<Child1>-->RemoveContext Node function>Split by Value(set the property as on value change)->CollapseContext</Child1>

<Child2>-->RemoveContext Node function>Split by Value(set the property as on value change)->CollapseContext</Child2>

Regards,

Shweta.

Former Member
0 Kudos

Hi Sweta,

Thanks so much for your reply but this didnu2019t work! I am getting the target response as

<List>

<ParentNode>

<Child1>PK1</Child1>

<Child2>SomeValue1</Child2>

</ParentNode>

<ParentNode></ParentNode>

<ParentNode></ParentNode>

</List>

I don't want the second <ParentNode> and want value for the third <ParentNode> one as there is a value change! Did I miss anything!

Thanks

Former Member
0 Kudos

Hi,

Please note that in my reply I asked you to map ParentNode with <Child1> Please see the below.

<Child1>-->RemoveContext Node function>Split by Value(set the property as on value change)->CollapseContext---<ParentNode>

Secondly: introduce split by value(for each value ) after collapse context for child1 and child2. as shown below.

<Child1>-->RemoveContext Node function>Split by Value(set the property as on value change)->CollapseContext>Split by value(for each value)----</Child1>

<Child2>-->RemoveContext Node function>Split by Value(set the property as on value change)->CollapseContext>Split by value(for each value)----</Child2>

it will surely work,

Former Member
0 Kudos

Shewta,

Ahhu2026 it worked like charmu2026.Full marks to you!

Thanks so much

Answers (2)

Answers (2)

Former Member
0 Kudos

This message was moderated.

former_member200962
Active Contributor
0 Kudos

there is a standard function SplitByValue(Keep option as Value Change)....this will help you in passing only one of the many duplicate values.....just make a search on SDN with SpliByValue....if i remember there is even one blog which shows the functionality....

Regards,

Abhishek.