AnsweredAssumed Answered

C# Newtonsoft PiWebApi Question

Question asked by guntonre on May 30, 2018
Latest reply on May 30, 2018 by Lonnie Bowling

Here is my json

{

  "Links": {},

  "Items": [

  {

  "Type": "Maximum",

  "Value": {

  "Timestamp": "2018-05-28T02:39:55Z",

  "Value": 4.6246604919433594,

  "UnitsAbbreviation": "",

  "Good": true,

  "Questionable": false,

  "Substituted": false

  }

  },

  {

  "Type": "Maximum",

  "Value": {

  "Timestamp": "2018-05-28T18:39:55Z",

  "Value": 5.3979134559631348,

  "UnitsAbbreviation": "",

  "Good": true,

  "Questionable": false,

  "Substituted": false

  }

  }

  ]

}

 

Here is how i'm getting the items in to a foreach loop

var mvaData = (JArray)JObject.Parse(mvajson)["Items"];

foreach (JObject mvaItem in mvaData)

{

 

How do I move deeper to grab the set of Values in the Items so I can loop through the values. I tride to do another JObject.Parse but it was coming up with a conversion error.

Outcomes