VA Rest

Hello,

I make a request with VA Rest or web communicator plugins. I receive data but I can’t do anything with it because it arrives in the form of a large packet:

[{“DATA1”:120,“DATA2”:“56”,“DATA3”:26},{“DATA1”:137,“DATA2”:“754”,“DATA3”:84}]

How to transform this into json in order to be able to exploit them?

Thanks for your help

JD

Valid JSON usable from VA Rest for your data would look like this.
I find JSONLint is useful for testing JSON structure and formatting. Hope this helps a bit. Good luck!

{
    "array": {
        "object1": {
            "DATA1": 120,
            "DATA2": "56",
            "DATA3": 26
        },
        "object2": {
            "DATA1": 137,
            "DATA2": "754",
            "DATA3": 84
        }
    }
}

I’m seeing a lack of useful documentation but… There’s a built in JSON library in current versions

First of all, thank you for your response.

I succeeded but I’m really not sure if it’s the right method.

You can see my blueprint here, don’t hesitate to give me comments and/or send me tutorials where I can improve my level regarding the recovery and processing of data:

JD
PS : DATA1, DATA2 were an exemple, I have other names of entry.

1 Like