How to sort objects in an array based on a nested date field?

What I would like to do is sort an array of (extended) objects based on the value of a field that comes from an object extension - which is a date type field. I would like to sort the array of objects in order of latest date value (so objects with the most recent date values are listed first) and on the flip side also be able to order them by oldest date value.

My issue is firstly, how do I parse the date field of the objects with dot notation, as it is a field that comes from an object addon - that is extended off another object addon - that extends off the ‘root’ object, I haven’t seen examples of parsing fields outside of the ‘root’ object.

I also haven’t seen any date specific sort options in the sort filter, the most promising I’ve seen is a numeric sort and I’m not sure that would work for date values. I have watched quite a few Xano videos but cant quite come to a resolve.

An example of the structure of all the objects in my array:

I want to sort the collection of these objects based on the value of the field ‘delivery_date’ (red text). For instance having the object with the oldest delivery date put at the top of the array, then the next oldest is second and etc.

My problem: How do I parse the field ‘delivery_date’ with dot notation (into the sort filters path) - given that it is in an addon of an addon?

Secondly, if I can parse this field, how can the objects sort to chronological date order? I don’t see the appropriate sort type in the dropdown menu.

Im guessing instead of using the ‘Update Variable’ function to sort and update my array - I will probably have to use a For Each loop instead?

I watched the helpful video below but I’m still stuck. Any help is appreciated, thanks.

https://www.youtube.com/watch?v=xi_5a4jsocQ

2
4 replies