AJO Advanced Expressions – extracting attribute from latest object in array
I have an array of objects and need to:
- Identify the object with the latest timestamp
- Return only that object
- Access a specific attribute (e.g.
email) from the selected object - 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-->
