Working with dates inside an array

:bullseye: What is your goal?

I get an array of dates, and I want to check which date in the array is the most recently updated.

:thinking: What is the problem & what have you tried?

I am unable to create a formula that can determine the most recent date in an array.

:clipboard: Error messages or input/output bundles

[
{
“start_date”: “2025-04-01”
},
{
“start_date”: “2025-07-01”
},
{
“start_date”: “2025-07-01”
}
]

:link: Create public scenario page

https://us2.make.com/public/shared-scenario/upodbT01Fa9/maxio-hubspot-integration-for-invoice

You can add a Tools (Set Variable) module after your array iterator/aggregator with this expression:

{{max(map({{1.bundles}}; “start_date”))}}

This will extracts all start_date values into an array ["2025-04-01", "2025-07-01", "2025-07-01"], then returns the maximum (“2025-07-01”).

Hi Karmic,

Thanks for the solution, i’ve already tried it and it doesnt work.
I get nothing in the output.

Welcome to the Make community!

To do this, you can use these built-in functions:

  • map
    map(complex array; key; [filter by key]; [csv-values for filtering])

  • sort
    sort(array; [order]; [key])

  • last
    last(array)

These functions may have also been covered in the Make Academy tutorials — refer to the Make Academy Course Overview to learn more.

Here’s an example of how you can use these functions together:

{{ last(sort(map(1.array; "start_date"))) }}
(Make Input Markup: Copy-paste the above into the field, including start/end curly brackets for it to import as intended)

e.g.:
Screenshot 2026-01-01 105001
Screenshot 2026-01-01 105037

Hope this helps! If you are still having trouble, please provide more details.

— @samliew

Unfortunately, this wouldn’t work.

The built-in max function only works on numbers, not strings, which is clearly indicated in the variables panel:

I would suggest completing the Make Academy before assisting others.

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 —

Learn Make

How-Tos

Useful to Know

My Custom App — Absolutely Free!

Save development time and operation credits with these utility modules: Chunk Text; Chunk Array; Chunk Words; Multiple Find & Replace; Collection to Array/String List; Execute JavaScript; Estimate Tokens; Calculate Difference Between Two Dates; Get Next Business Day (with holidays); List Upcoming Dates of Day of Week; and more!

— @samliew