How to do nested IIF logic in AEP Edge Mapping - Is it even possible for arrays? | Community
Skip to main content
Stewart_Schilling
Community Advisor
Community Advisor
August 9, 2022
Solved

How to do nested IIF logic in AEP Edge Mapping - Is it even possible for arrays?

  • August 9, 2022
  • 1 reply
  • 904 views

I have a situation where I need to reference different paths of the data object depending on what event type is being collected.  The structure of the data object loosely follows the old W3C data layer spec where there is product information held in product[*] for "product views", in cart.item[*] for "cart views" and in transaction.item[*] for "order placed" events.

I've pretty much given up on doing an edge mapping for this (and will use client-side code instead) but I want to know if it is even possible. 

Here's an example of a nested IIF that I was trying to use. 

iif( contains_key("data.eventNames.cartViewed") && contains_key("data.eventNames.pageLoadCompleted") , data.cart.item[*].productInfo.productID, iif( contains_key("data.eventNames.orderPlaced") && contains_key("data.eventNames.pageLoadCompleted") , data.transaction.item[*].productInfo.productID, iif( contains_key("data.eventNames.cartViewed") && contains_key("data.eventNames.pageLoadCompleted") , data.cart.item[*].productInfo.productID, iif( contains_key("data.eventNames.productViewed") && contains_key("data.eventNames.pageLoadCompleted") , data.product[*].productInfo.productID, ""))))

 

Thanks in advance, 

-Stew

 

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 Stewart_Schilling

Having assumed that it is either not possible or that it is untenable (if possible), I have created the AA via AEP Web SDK extension for Adobe Data Collection (Launch).  This makes it very easy to accomplish the task of data collection for Adobe Analytics using the AEP Web SDK.  The extension is public and is freely available for use. 

1 reply

Stewart_Schilling
Community Advisor
Stewart_SchillingCommunity AdvisorAuthorAccepted solution
Community Advisor
December 20, 2022

Having assumed that it is either not possible or that it is untenable (if possible), I have created the AA via AEP Web SDK extension for Adobe Data Collection (Launch).  This makes it very easy to accomplish the task of data collection for Adobe Analytics using the AEP Web SDK.  The extension is public and is freely available for use.