Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Adapter for Structured Data Files

JSONPath syntax for value retrieval

  • Last UpdatedJul 16, 2025
  • 4 minute read

For information on which semantic is used for retrieving values from JSON files, see JSONPath Syntax.

The following syntax is used to extract values from JSON documents.

JSON - Simple JSONPath example

[

{

"time": "2024-08-10T12:10:46.0928791Z",

"value": 1.234567890

},

{

"time": "2024-08-10T12:10:47.0928791Z",

"value": 12.34567890

},

{

"time": "2024-08-10T12:10:48.0928791Z",

"value": 123.4567890

},

{

"time": "2024-08-10T12:10:49.0928791Z",

"value": 1234.567890

},

{

"time": "2024-08-10T12:10:50.0928791Z",

"value": 12345.67890

},

{

"time": "2024-08-10T12:10:51.0928791Z",

"value": 123456.7890

},

{

"time": "2024-08-10T12:10:52.0928791Z",

"value": 12345678.90

},

{

"time": "2024-08-10T12:10:53.0928791Z",

"value": 123456789.0

}

]

The following data selection item configuration with JSONPath reads a series of values:

[

{

"valueField": "$[*].value",

"indexField": "$[*].time",

"dataType": "float64",

"selected": true

}

]

JSON - Complex JSONPath examples

The following example reads specific values from a JSON array:

{

"StreamData": {

"TPPrototype.uflsample.value_time": [

{

"StreamId": "TPPrototype.uflsample.value_time",

"DataType": "Double",

"Timestamp": "2024-12-01T06:00:00Z",

"Value": 339.0

},

{

"StreamId": "TPPrototype.uflsample.value_time",

"DataType": "Double",

"Timestamp": "2024-12-01T07:00:00Z",

"Value": 344.0

},

{

"StreamId": "TPPrototype.uflsample.value_time",

"DataType": "Double",

"Timestamp": "2024-12-01T17:00:00Z",

"Value": 341.0

}

],

"TPPrototype.uflsample.value_timeString": [

{

"StreamId": "TPPrototype.uflsample.value_timeString",

"DataType": "String",

"Timestamp": "2024-12-01T06:00:00Z",

"Value": "339.0"

},

{

"StreamId": "TPPrototype.uflsample.value_timeString",

"DataType": "String",

"Timestamp": "2024-12-01T07:00:00Z",

"Value": "344.0"

},

{

"StreamId": "TPPrototype.uflsample.value_timeString",

"DataType": "String",

"Timestamp": "2024-12-01T17:00:00Z",

"Value": "341.0"

}

],

"TPPrototype.uflsample.pressure_time": [

{

"StreamId": "TPPrototype.uflsample.pressure_time",

"DataType": "Double",

"Timestamp": "2024-12-01T06:00:00Z",

"Value": 339.0

},

{

"StreamId": "TPPrototype.uflsample.pressure_time",

"DataType": "Double",

"Timestamp": "2024-12-01T07:00:00Z",

"Value": 344.0

},

{

"StreamId": "TPPrototype.uflsample.pressure_time",

"DataType": "Double",

"Timestamp": "2024-12-01T17:00:00Z",

"Value": 341.0

}

]

}

}

The following data selection item configuration with JSONPath reads all the TPPrototype.uflsample.value_time values from the JSON above:

[

{

"valueField": "$['StreamData'].['TPPrototype.uflsample.value_time'][*].Value",

"indexField": "$['StreamData'].['TPPrototype.uflsample.value_time'][*].Timestamp",

"dataType": "float64",

"selected": true

}

]

The following data selection item configuration with JSONPath uses a filter expression to read all the TPPrototype.uflsample.value_time values with a value greater than 340 from the JSON above:

[

{

"valueField": "$.StreamData.['TPPrototype.uflsample.value_time'][?(@.Value>340)].Value",

"indexField": "$.StreamData.['TPPrototype.uflsample.value_time'][?(@.Value>340)].Timestamp",

"dataType": "float64",

"selected": true

}

]

The following example reads specific values from a JSON array:

{

"powerDateValuesList": {

"timeUnit": "QUARTER_OF_AN_HOUR",

"unit": "Wh",

"count": 1,

"siteEnergyList": [

{

"siteId": 1338075,

"powerDataValueSeries": {

"measuredBy": "METER",

"values": [

{

"date": "2021-09-23 06:00:00",

"value": 0.0

},

{

"date": "2021-09-23 06:15:00",

"value": 0.0

},

{

"date": "2021-09-23 06:30:00",

"value": null

},

{

"date": "2021-09-23 06:45:00",

"value": null

},

{

"date": "2021-09-23 07:00:00",

"value": 35.29568

},

{

"date": "2021-09-23 07:15:00",

"value": 280.98932

},

{

"date": "2021-09-23 07:30:00",

"value": 541.07477

},

{

"date": "2021-09-23 07:45:00",

"value": 508.92096

}

]

}

}

]

}

}

The following data selection item configuration with JSONPath uses a filter expression to read all values that are not null from the JSON above:

[

{

"valueField": "$..siteEnergyList[0].powerDataValueSeries.values[?(@.value!=null)].value",

"indexField": "$..siteEnergyList[0].powerDataValueSeries.values[?(@.value!=null)].date",

"dataType": "float64",

"selected": true

}

]

The following example reads specific value from complex nested JSON:

{

"success": true,

"error": null,

"result": {

"type": "runtime_history",

"chart": {

"chart": {

"type": "column"

},

"title": {

"text": ""

},

"subtitle": {

"text": "Daily History"

},

"colors": [

"#fee292",

"#fdc152",

"#f69638",

"#f17130",

"#9f2d26",

"#8acadc",

"#184c8e"

],

"series": [

{

"name": "Stage 3 Aux Heat",

"data": [

0.0,

0.0,

0.0,

0.0,

0.0,

0.0,

0.0,

0.0,

0.0

],

"stack": "heat",

"state": "heat_aux_stage3"

},

{

"name": "Stage 2 Aux Heat",

"data": [

0.0,

0.0,

0.0,

0.0,

0.0,

0.0,

0.0,

0.0,

0.0

],

"stack": "heat",

"state": "heat_aux_stage2"

},

{

"name": "Aux Heat",

"data": [

0.0,

0.0,

0.0,

0.0,

0.0,

0.0,

0.0,

0.0,

0.0

],

"stack": "heat",

"state": "heat_aux"

},

{

"name": "Stage 2 Heat",

"data": [

0.0,

0.0,

0.0,

0.0,

0.0,

0.0,

0.0,

0.0,

0.0

],

"stack": "heat",

"state": "heat_stage2"

},

{

"name": "Heat",

"data": [

0.0,

0.2,

0.0,

0.0,

0.0,

0.0,

0.3,

0.2,

0.0

],

"stack": "heat",

"state": "heat"

},

{

"name": "Stage 2 Cool",

"data": [

0.0,

0.0,

0.0,

0.0,

0.0,

0.0,

0.0,

0.0,

0.0

],

"stack": "cool",

"state": "cool_stage2"

},

{

"name": "Cool",

"data": [

0.0,

0.0,

0.0,

0.0,

0.0,

0.0,

0.0,

0.0,

0.0

],

"stack": "cool",

"state": "cool"

}

],

"xAxis": {

"categories": [

"Friday",

"Saturday",

"Sunday",

"Monday",

"Tuesday",

"Wednesday",

"Thursday",

"Friday",

"Saturday"

],

"labels": {

"rotation": -45

}

},

"yAxis": {

"allowDecimals": false,

"min": 0,

"max": 24,

"tickInternval": 4,

"title": {

"text": "Runtime (Hours)"

}

},

"legend": {

"layout": "vertical",

"align": "center",

"floating": false,

"shadow": false,

"itemStyle": {

"fontSize": "1em"

}

},

"tooltip": {

"shared": true,

"borderColor": "#000000"

},

"credits": {

"enabled": false

},

"plotOptions": {

"column": {

"stacking": "normal"

},

"series": {

"shadow": false

}

}

},

"table": {

"headings": [

"Fri",

"Sat",

"Sun",

"Mon",

"Tue",

"Wed",

"Thu",

"Fri",

"Sat"

],

"series": [

{

"name": "Aux Heat",

"data": [

0.0,

0.0,

0.0,

0.0,

0.0,

0.0,

0.0,

0.0,

0.0

],

"stack": "heat",

"state": "heat_aux"

},

{

"name": "Outdoor High Temp.",

"data": [

72.0,

64.0,

73.0,

72.0,

67.0,

73.0,

77.0,

62.0,

51.0

],

"stack": null,

"state": "outdoor_high_temperature"

},

{

"name": "Outdoor Low Temp.",

"data": [

55.0,

60.0,

62.0,

61.0,

51.0,

43.0,

46.0,

44.0,

35.0

},

"stack": null,

"state": "outdoor_low_temperature"

},

{

"name": "Avg Indoor Temp.",

"data": [

76.0,

77.0,

78.0,

78.0,

77.0,

73.0,

74.0,

75.0,

72.0

],

"stack": null,

"state": "average_indoor_temperature"

},

{

"name": "Avg Indoor Humidity",

"data": [

66.0,

68.0,

70.0,

70.0,

69.0,

67.0,

67.0,

66.0,

61.0

],

"stack": null,

"state": "average_indoor_humidity"

},

{

"name": "Fan Only Runtime",

"data": [

0.0,

0.0,

0.0,

0.0,

0.0,

0.0,

0.0,

0.0,

0.0

],

"stack": null,

"state": "fan_only"

},

{

"name": "Vent",

"data": [],

"stack": null,

"state": "vent"

}

]

},

"show_monthly_runtime_history": true

}

}

The following data selection item configuration with JSONPath reads Sunday Average Indoor Temperature from the JSON above. The timestamp comes from Adapter local time.

[

{

"valueField": "$.result.table.series[3].data[2]",

"indexField": null,

"dataType": "float64",

"selected": true

}

]

Error handling

If you encounter text parser related errors that is errors for the ValueField or IndexField, check the StreamId associated with the error message.

Possible errors include the following:

  • The JSONPath expression of ValueField or IndexField is pointing to a non-existing value

  • The JSONPath expression of ValueField or IndexField is missing a value altogether

  • DataType does not match the value

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in