subarrays issue
subarrays issue
RayHerring
Posts: 11Questions: 5Answers: 0
Trying to work out how to access values in arrays in arrays in objects.
My JSON returned from the server is:
{"dsSalesReport": {
"ttSalesReport": [
{
"Serial_Number": 1341,
"Sort_Name": "AIR CONDITIONING FUEL LINE DISCONECT SET",
"ttSalesReportData": [
{
"Serial_Number": 1341,
"Current_Sales_Periods": [
201407,
201406,
201405,
201404,
201403,
201402,
201401,
201312,
201311,
201310,
201309,
201308,
201307
],
"Current_Sales": [
0.00,
39.19,
89.65,
139.75,
84.64,
71.46,
132.28,
113.38,
130.21,
103.01,
176.48,
80.02,
125.21
],
"Current_Sales_Qty": [
0,
3,
7,
11,
6,
6,
11,
9,
10,
8,
12,
6,
10
],
"Current_Sales_Total": 0,
"Last_Sales_Periods": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
"Last_Sales": [
0.00,
0.00,
0.00,
0.00,
0.00,
0.00,
0.00,
0.00,
0.00,
0.00,
0.00,
0.00,
0.00
],
"Prev_Last_Sales_Periods": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
"Prev_Last_Sales": [
0.00,
0.00,
0.00,
0.00,
0.00,
0.00,
0.00,
0.00,
0.00,
0.00,
0.00,
0.00,
0.00
]
}
]
},
{
"Serial_Number": 1342,
"Sort_Name": "AIR CONDITIONING FUEL LINE",
"ttSalesReportData": [
{
"Serial_Number": 1342,
"Current_Sales_Periods": [
201407,
201406,
201405,
201404,
201403,
201402,
201401,
201312,
201311,
201310,
201309,
201308,
201307
],
"Current_Sales": [
0.00,
39.19,
89.65,
139.75,
84.64,
71.46,
132.28,
113.38,
130.21,
103.01,
176.48,
80.02,
125.21
],
"Current_Sales_Qty": [
0,
3,
7,
11,
6,
6,
11,
9,
10,
8,
12,
6,
10
],
"Current_Sales_Total": 0,
"Last_Sales_Periods": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
"Last_Sales": [
0.00,
0.00,
0.00,
0.00,
0.00,
0.00,
0.00,
0.00,
0.00,
0.00,
0.00,
0.00,
0.00
],
"Prev_Last_Sales_Periods": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
"Prev_Last_Sales": [
0.00,
0.00,
0.00,
0.00,
0.00,
0.00,
0.00,
0.00,
0.00,
0.00,
0.00,
0.00,
0.00
]
}
]
}
]
}
Trying to work out how to access the things like 'Current_Sales_Qty' based on what i could read, it sounds like i should be able to set up in the 'columns' section ones that do things like 'ttSalesReportData.Current_Sales_Qty.0', etc... but it doesn't seem to work for me.
This discussion has been closed.
Answers
Have also tried: ttSalesReportData.0.Current_Sales_Qty.0 and while that stops error messages from appearing, all i see in the columns is '0'.
n/m, it did work, i just hadn't restarted my web service after changing something.