Skip to Content

Sorting CPI- XML source

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)

sort-xml1.png (20.1 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Nov 08, 2019 at 08:37 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.