I am trying leverage Advance experssion under AJO Condition to check if the product quantity is 0.
For this I am using filter function, the reference url is:
Here, Everytime I am getting the casting error saying invalid expression
The expression is invalid : The type of the value returned by the expression is invalid. The type is a listObject. Expected type is a boolean.
screenshot for reference
Solved! Go to Solution.
Views
Replies
Total Likes
You can take a look at the examples mentioned in this link https://experienceleague.adobe.com/en/docs/journey-optimizer/using/orchestrate-journeys/building-adv... which has references on how to access attributes within a listObject.
Example
@event{demoEvent.productListItems.all(currentEventField.priceTotal >= 150).quantity}==0
Hello @mustufam5967803 ,
Expression Activity always look for Boolean output.(True/False)
The expression that you have written is returning the object which is not accepted by Condition activity.
You can try below expression if that helps,
#{PATH_TO_PRODUCT_Array.all(currentDataPackField.product.quantity == 0)}
PATH_TO_PRODUCT_Array -> this should be path of your productListItems as er your screenshot.
The above expression will return true if all products in the productArray have a quantity of 0, and false otherwise.
If you want to check if any product in the array has a quantity of 0, you should use a below approach.
#{PATH_TO_PRODUCT_Array.any(currentDataPackField.product.quantity == 0)}
Views
Replies
Total Likes
You can take a look at the examples mentioned in this link https://experienceleague.adobe.com/en/docs/journey-optimizer/using/orchestrate-journeys/building-adv... which has references on how to access attributes within a listObject.
Example
@event{demoEvent.productListItems.all(currentEventField.priceTotal >= 150).quantity}==0
Thank you @dugganab and @pradeepg5044331 ,
The all and any functions are somewhat help me but my real pain is I need to sort event data based on product quantity, specifically when the quantity is 0. Is there a way to achieve this in AJO?
Views
Replies
Total Likes
You can explore the sort function https://experienceleague.adobe.com/en/docs/journey-optimizer/using/orchestrate-journeys/building-adv... if that helps.
Views
Likes
Replies