Expand my Community achievements bar.

Dive in, experiment, and see how our AI Assistant Content Accelerator can transform your workflows with personalized, efficient content solutions through our newly designed playground experience.
SOLVED

Looping through nested collections

Avatar

Level 7

Hi there,

 

We have a schema structure that looks like this:

(#{ExperiencePlatform.ABC.profile.tenantid.DDDOfferRecos.all(currentDataPackField.AA.AAOffers.ServiceAddress.offerCategory == "Fastfood").AA.customerID}

 

- DDDOffersRecos is an array

- ServiceAddress is also an array

 

I want to loop through all the arrays, and find the first object that has offerCategory == "Fastfood", and return the customerID at the AA object level. 

 

Is it possible to achieve this?

 

Thanks.

 

 

 

1 Accepted Solution

Avatar

Correct answer by
Employee

You can take a look at the following example in the documentation https://experienceleague.adobe.com/en/docs/journey-optimizer/using/orchestrate-journeys/building-adv... 

#{ExperiencePlatform.ExperienceEventFieldGroup.experienceevent.all(currentDataPackField._aepgdcdevenablement2.purchase_event.receipt_nbr == "10-337-4016").
_aepgdcdevenablement2.purchase_event.productListItems. all(currentDataPackField.SKU == "AB17 1234 1775 19DT B4DR 8HDK 762").name}

 

As I don't have visibility to the actual schema, you can validate it on the following lines. 

 

#{ExperiencePlatform.ABC.profile.tenantid.DDDOfferRecos.all(<apply filters based on DDDOfferRecos object array attributes>).AA.AAOffers.ServiceAddress.all(<apply filters based on ServiceAddress object array attributes>).customerID}

 

 

View solution in original post

1 Reply

Avatar

Correct answer by
Employee

You can take a look at the following example in the documentation https://experienceleague.adobe.com/en/docs/journey-optimizer/using/orchestrate-journeys/building-adv... 

#{ExperiencePlatform.ExperienceEventFieldGroup.experienceevent.all(currentDataPackField._aepgdcdevenablement2.purchase_event.receipt_nbr == "10-337-4016").
_aepgdcdevenablement2.purchase_event.productListItems. all(currentDataPackField.SKU == "AB17 1234 1775 19DT B4DR 8HDK 762").name}

 

As I don't have visibility to the actual schema, you can validate it on the following lines. 

 

#{ExperiencePlatform.ABC.profile.tenantid.DDDOfferRecos.all(<apply filters based on DDDOfferRecos object array attributes>).AA.AAOffers.ServiceAddress.all(<apply filters based on ServiceAddress object array attributes>).customerID}