Data Element | Custom Code | Products info
Hi Community,
I have trouble retrieving information from a data element.
I try to retrieve the value of the "condition" variable of my products in a data element "Adobe Analytics - Product - Condition".
Here are some screenshots to explain what I did:

Here is the custom code inside:
Returns 1 if the value is "new", else if it's "used" return 0.
var productCondition;
switch (true){
case (digitalData.product[0].attributes.condition === "new"):
productCondition = 1;
break;
case (digitalData.product[0].attributes.condition === "used"):
productCondition = 0;
break;
}
return productCondition;
What I can see from the console is the following:

First I tested the code itself. Then I just tried to call my Data Element.
I'm getting the expected result with the code, but when I call the Data Element, it says it's likely setup incorrectly.
I don't get why. I pushed my data element in my development environment. I'm doing my tests on my development website but I'm not understanding the error here.
Does anyone has any suggestions here please ?
Thank you

