Expand my Community achievements bar.

Join us on September 25th for a must-attend webinar featuring Adobe Experience Maker winner Anish Raul. Discover how leading enterprises are adopting AI into their workflows securely, responsibly, and at scale.
SOLVED

Retrieving id from profile.timeSeriesEvents.identityMap in AJO offer

Avatar

Level 2

Hi everyone, 

 

I'm wondering if anyone had successfully retrieved Id from profile.timeSeriesEvents.identityMap in an AJO offer. 

I had no problem retrieving the id using this helper function. {%= head(get(profile.identityMap,"accountId")).id %}

However, when I use the same formula for profile.timeSeriesEvents.identityMap: 

{%= head(get(profile.timeSeriesEvents.identityMap,"accountId")) %}, it throws this error: 
Invalid syntax get applied to an array requires integer parameter - was: STRING., Object expression for "head" must be of type array. Was Map[STRING => OBJECT[]].. Error beginning at position: Line 5, Character 23
 
 

Appreciate any tips on this. 

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

yes there are certain limitations when using profile.timeSeriesEvents (and its fields, like identityMap). just thinking it may be due to limited support for iterating or calling deep-access helpers on collections/arrays within offers.  https://experienceleague.adobe.com/en/docs/journey-optimizer/using/content-management/personalizatio...

View solution in original post

3 Replies

Avatar

Employee Advisor

@FrankXu3 profile.timeSeriesEvents is an array of event objects, each with its own identityMap. profile.timeSeriesEvents.identityMap means: "the array of identityMaps for each event"  so it’s actually an array of maps, not a map by itself.

try this:

  • select the first event, then access its identityMap:
    {%= head(get(head(profile.timeSeriesEvents).identityMap, "accountId")).id %}
    
    • head(profile.timeSeriesEvents) — gets the first event object
    • .identityMap — gets that event's identityMap
    • get(..., "accountId") — gets the array for "accountId", e.g. [{"id":"xxx"}]
    • head(...).id — gets the first id

Avatar

Level 2

Hey Mayank. Thanks for the response. I've tried that already and it would return false. 

In the offer, if I use head(profile.timeSeriesEvents.identityMap), I'd get false as well. but if I just put {{profile.timeSeriesEvents.identityMap}}, it would return the whole identitymap object. I am wondering if it's because timeseriesevents is not fully supported in the offer yet.

Avatar

Correct answer by
Employee Advisor

yes there are certain limitations when using profile.timeSeriesEvents (and its fields, like identityMap). just thinking it may be due to limited support for iterating or calling deep-access helpers on collections/arrays within offers.  https://experienceleague.adobe.com/en/docs/journey-optimizer/using/content-management/personalizatio...