Forum Discussion
HI elena14 - if your JSON event data structure is like the one shown above, you will need to use dot notation to access the nested data. Please try the following and see if it works:
To display the name of the first product:
{{purchases[0].properties.products[0].name}}
To display the name of the second product:
{{purchases[0].properties.products[1].name}}
and so on...
- elena143 months agoPractitioner
Hello inespais ,
I tried your suggestion and unfortunately it is not working. 😐
Do you know what can be the issue here?
- inespais3 months agoPractitioner II
Hey elena14 - are you able to share an example of your JSON event structure? I believe the one above might be taken from Braze's documentation. Even if your's is really similar, a small difference (structure, naming, etc) might be the key here.
- elena143 months agoPractitioner
Hello inespais , Please see the JSON payload here:
{ "purchases": [ { "external_id": "2023_new", "product_id": "Order Level", "currency": "MKD", "price": 230.98, "properties": { "products": [ { "name": "Sunscreen", "category": "Health", "product_amount": 20.09 }, { "name": "Lipstick", "category": "Cosmetics", "product_amount": 25.99 } ] }, "time": "2024-06-24T11:35:30+01:00" } ] }
And this is how the campaign is being set up.
Can it be related to the fact that
- Event property schemas cannot be generated for purchase events.
As it is stated in the documentation here
Many thanks,
Elena
Related Content
- 4 months ago