Having problem retrieve the data
-
The following is what I got from api call. I would like to show data in weatherElement array which is combined as elementName&elementValue.
I set basenode as location and template as
{subloop-array:weatherElement:-1}{elementName}{elementValue} {/subloop:weatherElement}but with no luck.
Could you please give me some suggestion? Thanks!{
“success”: “true”,
“result”: {
“resource_id”: “O-A0001-001”,
“fields”: [
{
“id”: “lat”,
“type”: “Double”
},
{
“id”: “lon”,
“type”: “Double”
},
{
“id”: “locationName”,
“type”: “String”
},
{
“id”: “stationId”,
“type”: “String”
},
{
“id”: “obsTime”,
“type”: “Timestamp”
},
{
“id”: “elementName”,
“type”: “String”
},
{
“id”: “elementValue”,
“type”: “String”
},
{
“id”: “parameterName”,
“type”: “String”
},
{
“id”: “parameterValue”,
“type”: “String”
}
]
},
“records”: {
“location”: [
{
“lat”: “24.144778”,
“lon”: “121.264083”,
“locationName”: “合歡山”,
“stationId”: “C0H9C0”,
“time”: {
“obsTime”: “2021-06-16 16:00:00”
},
“weatherElement”: [
{
“elementName”: “TEMP”,
“elementValue”: “11.7”
},
{
“elementName”: “HUMD”,
“elementValue”: “1”
},
{
“elementName”: “PRES”,
“elementValue”: “678.3”
}
],
“parameter”: [
{
“parameterName”: “CITY”,
“parameterValue”: “南投縣”
},
{
“parameterName”: “CITY_SN”,
“parameterValue”: “13”
},
{
“parameterName”: “TOWN”,
“parameterValue”: “仁愛鄉”
},
{
“parameterName”: “TOWN_SN”,
“parameterValue”: “122”
}
]
}
]
}
}
- The topic ‘Having problem retrieve the data’ is closed to new replies.