Hi All,
I’m try to pull data from the following JSON, I;m able to pull values from the top level and within the VideoMetadata branch such as “JobStatus” and “Codec” however I’m having trouble with the code to pull the data from the Labels, Label branch for the value contained in “Name”. Below is the snip of the JSON and my code.
Any help Appreciated.
{
"JobStatus": "SUCCEEDED",
"VideoMetadata": {
"Codec": "h264",
"DurationMillis": 32270,
"Format": "QuickTime / MOV",
"FrameRate": 25.007747650146484,
"FrameHeight": 1080,
"FrameWidth": 1920
},
"NextToken": "EWz5UUwouYHy8wkHnfXKeA7pgBIj4j7GzHRfnibP8i9efv9oXV8RUeFKYK1d8Vj5PY/2gvkAvqPo",
"Labels": [
{
"Timestamp": 0,
"Label": {
"Name": "Adventure",
"Confidence": 50.74354934692383,
"Instances": [],
"Parents": [
{
"Name": "Leisure Activities"
}
]
}
},
{
"Timestamp": 0,
"Label": {
"Name": "Boat",
"Confidence": 96.60441589355469,
"Instances": [
{
"BoundingBox": {
"Width": 0.06501070410013199,
"Height": 0.166324645280838,
"Left": 0.41527944803237915,
"Top": 0.4101371467113495
},
"Confidence": 96.57678985595703
},
{
"BoundingBox": {
"Width": 0.07209968566894531,
"Height": 0.1852024793624878,
"Left": 0.5770155191421509,
"Top": 0.3925584554672241
},
"Confidence": 94.62499237060547
},
{
"BoundingBox": {
"Width": 0.05135205760598183,
"Height": 0.16055727005004883,
"Left": 0.542992889881134,
"Top": 0.419971764087677
},
"Confidence": 89.9786605834961
},
{
"BoundingBox": {
"Width": 0.07703933864831924,
"Height": 0.13837294280529022,
"Left": 0.8235676288604736,
"Top": 0.44508177042007446
},
"Confidence": 77.41576385498047
},
{
"BoundingBox": {
"Width": 0.08093808591365814,
"Height": 0.11271407455205917,
"Left": 0.7117553949356079,
"Top": 0.4803471267223358
},
"Confidence": 66.55744171142578
},
{
"BoundingBox": {
"Width": 0.052500661462545395,
"Height": 0.12892289459705353,
"Left": 0.9461998343467712,
"Top": 0.45804858207702637
},
"Confidence": 66.19795227050781
},
{
"BoundingBox": {
"Width": 0.04536215588450432,
"Height": 0.048764944076538086,
"Left": 0.9541170001029968,
"Top": 0.5467467904090881
},
"Confidence": 66.01787567138672
},
{
"BoundingBox": {
"Width": 0.06201972812414169,
"Height": 0.14266368746757507,
"Left": 0.8861428499221802,
"Top": 0.42416512966156006
},
"Confidence": 64.18550872802734
}
],
"Parents": [
{
"Name": "Vehicle"
},
{
"Name": "Transportation"
}
]
}
},
{
Xojo Code
[code]Dim jsonDict As Xojo.Core.Dictionary = Xojo.Data.ParseJSON(s.Result.ToText)
//Display the JobStatus
Dim JobStatus As Text = jsonDict.Value(“JobStatus”)
StatusTextField.text = JobStatus
Dim VideoMetadata As Xojo.Core.Dictionary = jsonDict.Value(“VideoMetadata”)
Dim Codec As Text = VideoMetadata.Value(“Codec”)
CodecTextField.Text = Codec
Dim Labels() As Auto = jsonDict.Value(“Labels”)
For Each Label As Xojo.Core.Dictionary In Labels
Dim Name As Text = Label.Value(“Name”)
LabelTextArea.AppendText(EndOfLine + Name)
Next
[/code]