Has XPathGetValue the ability to directly parse into a Record?

… or does this need to be done manually?

I essentially have an array of objects in JSON that look like this:

and I have created a Record named AlbumData which looks like:

I thought I could be able to directly ask vvvv to parse the data as a spread of AlbumData but it doesn’t work:

So this is what I am doing instead which works:

I wanted to know if this is the right approach or not, or does XPathGetValues has the ability to directly parse into records?


Another question I had is if my JSON file contains array of strings for example, JSONReader refuses to parse it. So I’d always need to go into the file and wrap the array in an object (eg. I have to convert ["a", "b"] to {"data": ["a", "b"]}. Is this a requirement that I cannot avoid?

Maybe try what @joreg proposed here:

1 Like

Not as such really, the closest actual example is your third image.
You would need first to deserialize data and create Objects from XML definitions.

It would be really helpful to check via the Help Browser (press F1) specifically the Category CoreLib → IO → Serialization.
“Deseialize ThirdParty Data” example and additionally how to “Register Custom Serializer”.

Regarding JSONReader I dont have much to add, maybe separate the two questions in different threads ?

I suppose you mean the fourth image which actually works?

1 Like

Oh, I didn’t come across joreg’s post earlier. Will look into it. Thank you!

@ajitid 4th true :D

Another solution I have discovered is to use DeserializeJson from VL.Serialization.MessagePack. This can be useful if the JSON is not complicated and you don’t want to create a C# project for it.

VL.Serialization.MessagePack comes preinstalled in vvvv.

Here’s an example of DeserializeJson’s usage:
json-deserialize.zip (10.7 KB)

If you have XML, you can simply deserialise it using internally accessible serialisation / deserialisation tools.


XML_Deserialize.vl (6.4 KB)