We have the following JSON structure
I am trying to access data array values. I notice value names are numbers and somehow when trying to define the logic, they are not recognized. All the following had errors.
series[0].data[0].0
series[0].data[0].0[0]
series[0].data[0]."0"
series[0].data[0].'0'
The error message is "member '0' not found"
(swapping the last part of the logic, same error on every attempt)
Could you please help me figure out if there is a sytanx problem or something else?
This is the first part only non-processed dummy data
{
"request": {
"command": "dummy",
"series_id": "dummy"
},
"series": [
{
"series_id": "dummy",
"name": "dummy",
"units": "dummy",
"f": "W",
"unitsshort": "dummy",
"description": "dummy",
"copyright": "dummy",
"source": "dummy",
"start": "19900406",
"end": "20180803",
"updated": "2018-08-08T14:01:44-0400",
"data": [
[
"20180803",
2.104
],
[
"20180727",
2.11
],
[
"20180720",
2.042
],
...
BTW, I am using IBM Workload Scheduler to access an API to retrieve this data. The tool framewrok let's me specify the JSON Properties I want to get from the results. If I try to get the whole first array value I succeed
series[0].data[0]
JSONResult:[20180803, 2.104]
UPDATE
Adding screens from IBM Workload Scheduler
As was said in the comments, if you want to get the value
20180803
you should be usingseries[0].data[0][0]
. Here is an example: