xtechkid xtechkid - 6 months ago 53
JSON Question

Reading JSON Object Value in C# code

I am trying to access a json value from Azure ML rest service but i get a null value all the time, i tried different options but it did not work. Can u please provide ideas.

Json String

"Results": {
"output1": {
"type": "table",
"value": {
"ColumnNames": ["Sentiment",
"ColumnTypes": ["String",
"Values": [["negative",

Trying to fetch the value between **

Tried the below.

using Newtonsoft.Json.Linq;
JObject o = JObject.Parse(sentimentvalue);
string valv = (string)o.SelectToken("Results[0].output1[0].Values[0]");


Your JSON path in the SelectToken seems to be wrong. Try this:

string valv = (string)o.SelectToken("$.Results.output1.value.Values[0][1]");