AJO Advanced Expressions – extracting attribute from latest object in array | Community
Skip to main content
April 23, 2026
Question

AJO Advanced Expressions – extracting attribute from latest object in array

  • April 23, 2026
  • 1 reply
  • 22 views

I have an array of objects and need to:

  1. Identify the object with the latest timestamp
  2. Return only that object
  3. Access a specific attribute (e.g. email) from the selected object
  4. Use that value in an AJO journey condition

===========================================================================

🔹 Sample Data

!--scriptorstartfragment-->

"productDetails": [

  {

    "id": "product-001",

    "timestamp": "2026-04-23T02:00:38.000Z",

    "email": "email-001@nomail.com"

  },

  {

    "id": "product-004",

    "timestamp": "2026-04-23T02:30:38.000Z",

    "email": "email-004@nomail.com"

  },

  {

    "id": "product-002",

    "timestamp": "2026-04-23T02:10:38.000Z",

    "email": "email-002@nomail.com"

  },

  {

    "id": "product-003",

    "timestamp": "2026-04-23T02:20:38.000Z",

    "email": "email-003@nomail.com"

  }

]

===========================================================================
I was able to filter the objects based on the latest timestamp using filter() and max():
!--scriptorstartfragment-->

filter(

  #{ExperiencePlatform.ProfileFieldGroup.productDetails},

  "timestamp",

  [max(#{ExperiencePlatform.ProfileFieldGroup.productDetails.timestamp})]

)

This correctly returns the object with the latest timestamp.

===========================================================================

Expectation : Access an attribute like .email from the filtered result

Expected Output : email-004@nomail.com
!--scriptorendfragment-->!--scriptorendfragment-->!--scriptorstartfragment-->

!--scriptorendfragment-->

1 reply

Level 2
April 23, 2026

Hey ​@HarinathCh6 

 

Here’s the advanced expression for your use-case. Kindly try the below one. The below expression would conditionally filter the items that has the latest one and can be indexed at 0. Let me know if that helps!

 

getListItem(#{ExperiencePlatform.ProfileFieldGroup.productDetails.all(currentDataPackField.timestamp == 
max(#{ExperiencePlatform.ProfileFieldGroup.productDetails.all().timestamp})).email}, 0)

 

Cheers,
Ganesh Kumar