multiple data children in JSON trees

Vuo receives an OSC message with this value:

{“status”:“ok”,“data”:[{“number”:“1”,“uniqueID”:“E680367C-097E-4319-92BA-E108583C41BF”,“flagged”:false,“listName”:“Billionaire_Glee_Cast.mp3”,“type”:“Audio”,“colorName”:“none”,“name”:“”,“armed”:true},{“number”:“2”,“uniqueID”:“DAD8E848-5932-4CA0-920D-88B83DF213DB”,“flagged”:false,“listName”:“DontstopbelievingGleeCastG.mp3”,“type”:“Audio”,“colorName”:“none”,“name”:“”,“armed”:true}],“workspace_id”:“D711C621-2EA5-4C00-91F4-5E4A23E813E7”,“address”:“/workspace/D711C621-2EA5-4C00-91F4-5E4A23E813E7/runningOrPausedCues”}

The Make tree from JSON node shows 5 children
status
data
data
workspace_id
address

If I use a Find Subtree Node with Name “number” I get a value of “1”

How would I get the number from the second data child in the JSON message (i.e “2”)?

Thanks

Mic,

The node set documentation says, “A Tree’s name, attributes, and content refer to just one level of the Tree. Each child Tree has its own name, attributes, and content.” So you want to make sure you include descendants to get a list of the appropriate trees, and then process those trees to show the information you want. There is a simple example composition attached.

subtrees.vuo (3.09 KB)

1 Like

Thanks very much for this. It’s exactly what I needed and now I understand how it works it’s very powerful for my needs. . Although it’s simple once you know how, I doubt if I would have been able to work it out myself. The example composition helped enormously

1 Like

.