Sorting an object array by multiple criteria

Hi all,

I've a need to sort an object (top-level only, no way do I want to delve into nested sorts in sub-objects!) by multiple criteria, but on an object that is dynamically generated and thus cannot use the DB-level sort functionality (nor would I want this particular object to be stored in the DB, since it's session-specific data).

I'm weighing up my options on whether to embark on the process of creating my own reusable function to do this, but it's really doing my head in to make it reusable and not constrained to a fix number of parameters. I'm quite surprised Xano doesn't already have this function natively, as far as I can tell.

Has anyone come across an easy way to do this in Xano that doesn't involve nested loops, complex logic or custom JS in a lambda?

1 reply