Hi - hoping someone can help stop me pulling my hair out…
I have a REST sensor that returns the following JSON:
{
"@context" : "http://environment.data.gov.uk/flood-monitoring/meta/context.jsonld" ,
"meta" : {
"publisher" : "Environment Agency" ,
"licence" : "http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/" ,
"documentation" : "http://environment.data.gov.uk/flood-monitoring/doc/reference" ,
"version" : "0.9" ,
"comment" : "Status: Beta service" ,
"hasFormat" : [ "http://environment.data.gov.uk/flood-monitoring/id/stations/2077/readings.csv?latest", "http://environment.data.gov.uk/flood-monitoring/id/stations/2077/readings.rdf?latest", "http://environment.data.gov.uk/flood-monitoring/id/stations/2077/readings.ttl?latest", "http://environment.data.gov.uk/flood-monitoring/id/stations/2077/readings.html?latest" ]
},
"items" : [ {
"@id" : "http://environment.data.gov.uk/flood-monitoring/data/readings/2077-level-stage-i-15_min-mASD/2020-02-23T11-00-00Z" ,
"dateTime" : "2020-02-23T11:00:00Z" ,
"measure" : "http://environment.data.gov.uk/flood-monitoring/id/measures/2077-level-stage-i-15_min-mASD" ,
"value" : 3.518
}
]
}
I’m trying to extract the value from within the nested items array.
I’ve tried various templates such as:
{{value_json.items.value}}
{{value_json.[items].value}}
{{value_json.items[0].value}}
{{value_json.items.0.value}}
all unsuccessfully. Does anyone have any ideas?