Sort a complex array of collections

Hi Makers,

Here’s an overview of this section of the scenario.

  1. 39: The array aggregator outputs an array of collections (see output below).
  2. 46: The iterator breaks those down.
  3. 34: The text aggregator creates a single, comma-separated string.
[
    {
        "array": [
            {
                "Date": "2024-07-07",
                "webViewLink": "https://docs.google.com/document/d/XXX/edit?usp=drivesdk"
            },
            {
                "Date": "2024-07-01",               
                "webViewLink": "https://docs.google.com/document/d/XXX/edit?usp=drivesdk"
            },
            {
                "Date": "2024-07-03",
                "webViewLink": "https://docs.google.com/document/d/XXX/edit?usp=drivesdk"
            },
            {
                "Date": "2024-07-01",
                "webViewLink": "https://docs.google.com/document/d/XXX/edit?usp=drivesdk"
            },
            {
                "Date": "2024-06-30",
                "webViewLink":" https://docs.google.com/document/d/XXX/edit?usp=drivesdk"
            }
        ],
        "__IMTAGGLENGTH__": 5
    }
]

I have been trying to insert into the iterator the following inline formula to sort them, but because they’re collections this doesn’t work.

{{sort(39.array; 39.array[].Date)}}

Your input on how to sort this complex array by date would be appreciated.

You can use the built-in function sort

e.g.:

{{ sort(39.array; "asc"; "Date") }}

For more information, see the sort function documentation in the Help Center:

Screenshot_2024-06-29_220610

Here are some useful links and guides you can use to learn more on how to use the Make platform, apps, and app modules. I found these useful when I was learning Make, and hope they might benefit you too —

General

Help Center Basics

Articles & Videos

samliewrequest private consultation

Join the unofficial Make Discord server to chat with other makers!

2 Likes