cancel
Showing results for 
Search instead for 
Did you mean: 

Sorting CPI- XML source

chanchal_sap
Participant
0 Kudos

Hi

is there any way to sort incoming XML messages child node in CPI . We can write groovy script or some other way .

based on start date we need to sort the incoming message.sort-xml1.png(20.1 kB)

MortenWittrock
Active Contributor
0 Kudos

Hi Chanchal

Please also follow up on the answers to your other open question, when asking a new one.

Regards,

Morten

MortenWittrock
Active Contributor
0 Kudos

To clarify: When you have received the right answer to your question, accept that answer and close the question. Also, you can show your appreciation by upvoting answers that are helpful.

Regards,

Morten

Accepted Solutions (0)

Answers (1)

Answers (1)

gabriel_alves
Explorer
0 Kudos

Hi,

You can achieve this in a groovy or javascript. In javascript, with your object you can do that:

oMessage.arrList.sort( (a,b) => { return (a.StartDate < b.StartDate) ? 1 : -1 ; } );

I'm pretty sure that in groovy is similar.