Looping through nested collections | Community
Skip to main content
Level 6
May 31, 2024
Solved

Looping through nested collections

  • May 31, 2024
  • 1 reply
  • 692 views

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.

 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Mohan_Dugganab

You can take a look at the following example in the documentation https://experienceleague.adobe.com/en/docs/journey-optimizer/using/orchestrate-journeys/building-advanced-conditions-journeys/syntax/collection-management-functions 

#{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}

 

 

1 reply

Mohan_Dugganab
Adobe Employee
Mohan_DugganabAdobe EmployeeAccepted solution
Adobe Employee
June 3, 2024

You can take a look at the following example in the documentation https://experienceleague.adobe.com/en/docs/journey-optimizer/using/orchestrate-journeys/building-advanced-conditions-journeys/syntax/collection-management-functions 

#{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}