cancel
Showing results for 
Search instead for 
Did you mean: 

want to skip or overwrite if the value occurs morethan one time

sntamilselvan
Explorer
0 Kudos

Hi Experts !


Here is my issue.


In below mentioned line item I want skip or over write lineitems which are occuring morethan once. In below example MF <Line item information Party> is occure two times i want only one to be present per line item other line items should be skipped (Highlighted is to be skipped- originally available in INPUT payload).So, I need only one MF values in the payload.


<LineItemInformationParty>-

<PartyRoleCode>MF</PartyRoleCode>-

<LineItemInformationPartyReferences>

<PartyAdditionalID>ACOPIAN</PartyAdditionalID>

</LineItemInformationPartyReferences>

</LineItemInformationParty>-

<LineItemInformationParty>

<PartyRoleCode>MF</PartyRoleCode>-

<LineItemInformationPartyReferences>

<PartyAdditionalID>ACOPIAN</PartyAdditionalID>

</LineItemInformationPartyReferences>

</LineItemInformationParty>

Current mapping (Screenshot attached) logic for <Party Additional ID> - If QUALF =004 then Ktext value should be mapped to <Party Additional ID>

Current mapping (Screenshot attached) logic for <LineItemInformationPartyReferences> - if QUALF = 004 then create <LineItemInformationPartyReferences>

Current mapping (Screenshot attached) logic for <Party Role code> - Constant = MF

Current mapping (Screenshot attached) logic for <LineItemInformationParty>- if Qualf=004 then create <LineItemInformationParty>

Accepted Solutions (1)

Accepted Solutions (1)

sntamilselvan
Explorer
0 Kudos

Hi Team,

Thanks for all of your effort taken.

The above issue solves . Kindly see attached screenshots.

Missed Screenshot explanation :-

<PartyRoleCode> mapped to Constant=MF

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi Selvan,

Use the Function  "CopyValue" and use the index as 0 to skip the second occurrence.

<LineItemInformationParty>  ==>[CopyValue[0]] ==> <LineItemInformationParty>


It will skip all the other occurrence except the first one.

Former Member
0 Kudos

Hi

Create target segment <LineItemInformationParty> based on the unique values of KText in your input.

You can use node function sort or collapse context for that.

Then map PartyRoleCode with constant.

Map PartyAdditionalID with first value of Ktext. You can use function CopyValue for that.

If you can provide us the input xml , we can give u the exact mapping.

iaki_vila
Active Contributor
0 Kudos

Hi Tamil,

You can use the standard function CopyValue with the position 1 and you need to take into account the context for a right target xml. Check how it works in this link:

Standard Functions in PI 7.0 - Process Integration - SCN Wiki

Regards.

Former Member
0 Kudos

Hello Tamil,

You can use below logic to eliminate duplicates

<PartyRoleCode> ==> removeContext ==> sort (asc/desc) ==> SplitByValue (Value Change) ==> collapseContext ==> SplitByValue (Each Value) ==> TargetField.

this way we get only one Target field for multiple PartyRoleCode with same values.

former_member440061
Participant
0 Kudos


Hi ,

You may also use Collapse Context function to remove duplicates.

Harish
Active Contributor
0 Kudos

Hi Tamil,

can you provide the input xml? you need to find out the duplicate node in input, at the moment we have only one check qualf = 004.

Regards,

Harish

sntamilselvan
Explorer
0 Kudos

Hi Harish,

Sure. Ur mail ID ?

Harish
Active Contributor
Harish
Active Contributor
0 Kudos

Hi Tamil,

Please try with below map

for LineItemInformationParty, the context of QUALF is E1EDP01

for PartyRoleCode (please correct the input field as it is for example), the context of input fields is E1EDP01

for LineItemInformationPartyReferences), the context of input fields is E1EDP01

for PartyAdditionalID (please correct the input field as it is for example), the context of input fields is E1EDP01

Hope this help.

Harish