Forum Discussion

manohar's avatar
manohar
Contributor
4 years ago
Solved

Sort internal array

hi there, I have a inbound json thats coming this way. How can I sort the Order-Lines array based on line-num in asscending order. tried to use sort but did not work. any other solutions? Tha...
  • bojanvelevski's avatar
    4 years ago

    Hi @manohar,

    Use the following expression in a mapper:

    $['order-lines'].sort((a,b) => a['line-num'] - b['line-num'])

    Regards,
    Bojan