This is my JSON request :
{
"definitionKey": "SSJSTEST19",
"recipient":
{
"contactKey": "007",
"to": "sourabxxxxx",
"attributes": {
"EmailAddress": "sourabxxxxx",
"SubscriberKey": "Sourab",
"CUSTOMERNR": "123678",
"FirstName": "Sourab",
"Packages": [
{ "Name" : "Entertainment",
"Price" : "15 €",
"PaymentDate" : "01.07.2020"
},
{ "Name" : "Cinema",
"Price" : "15 €",
"PaymentDate" : "01.07.2020"
}
]
}
}
}
Here is my Code :
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center">
<table cellpadding="0" cellspacing="0" class="container" width="550">
<tr>
<td align="left" style="font-family: Helvetica,Arial,sans-serif; font-size: 16px; color: #4a4a4a; padding:px; line-height:24px; background:#F9F9F9;">
%%[
var @MyArray,@Array,@AllPackages,@email,@contactkey ,@First_Name,@CustomerNumber
set @email= emailaddr
set @contactkey = AttributeValue("Contact_Key")
set @CustomerNumber = AttributeValue("CUSTOMERNR")
set @First_Name = AttributeValue("FirstName")
set @AllPackages = AttributeValue("Packages")
]%%
<div style="text-align: right;">Kundennummer: %%=V(@CustomerNumber)=%%</div>
<br>
<b>Hallo %%=V(@First_Name)=%%</b>,<br>
<script runat="server">
Platform.Load("Core","1");
var arr = [];
var jsonString1 = Variable.GetValue("@AllPackages");
arr.push(Platform.Function.ParseJSON(jsonString1).message.views[0].content);
Write(Stringify(arr));
Variable.SetValue("@Array",arr);
</script>
%%[
SET @MyArray = @Array
]%%
<br>
%%=v(@MyArray)=%%
<br>
</td></tr></table></td></tr></table>
Result - After triggering the email, the array yields [null] result.