I have an array that looks like this
[{
"Inventory": {
"dashboard_id": "Inventory",
"filter_by": "Location",
"yAxis": "Quantity",
"title": "",
"chart_type": "-------Select-------",
"mainchart": "Yes"
},
"Quality": {
"dashboard_id": "Quality",
"filter_by": "Location",
"yAxis": "SampleNo",
"title": "",
"chart_type": "-------Select-------",
"mainchart": "Yes"
}
}]
I need to add more values into each object. How do I ADD to an existing array so it might look something like this
{
"Inventory": [{
"dashboard_id": "Inventory",
"filter_by": "Location",
"yAxis": "Quantity",
"title": "",
"chart_type": "-------Select-------",
"mainchart": "Yes"
}, {
"dashboard_id": "Inventory",
"filter_by": "Location",
"yAxis": "Quantity",
"title": "",
"chart_type": "-------Select-------",
"mainchart": "Yes"
}],
"Quality": {
"dashboard_id": "Quality",
"filter_by": "Location",
"yAxis": "SampleNo",
"title": "",
"chart_type": "-------Select-------",
"mainchart": "Yes"
}
}
I add into the array using nestedData[dashId] = data;
Where dashId consist of Quality, 'Inventory', etc.
data is
{
"dashboard_id": "Inventory",
"filter_by": "Location",
"yAxis": "Quantity",
"title": "",
"chart_type": "-------Select-------",
"mainchart": "Yes"
}