Welcome! Log In Create A New Profile


JSON vs Variant type of variables for JSON formatted data

Posted by Gus 
Hello All:

I'm dealing with information in JSON format and since I picked up some examples using variables of type variant, and continue working with this type of variable to load and process information in JSON format.

However, I later discovered the JSON type of variable, which seems to be more suitable for this. Since the variant type still works for what I need, I'm wondering what are the differences and if there are advantages by using JSON types of variables rater than variant types.

I would appreciate any comment on this.

Re: JSON vs Variant type of variables for JSON formatted data
May 04, 2021 08:51AM
Hi Gus

The variant solution was the solution to work with before the JSON variable type existed (Pre-V23 I believe).
Now you need to drop your JSON descriptions/definitions in the "external descriptions" in the project explorer and you can next use them natively including type-ahead and compilation error features.

Simply declare the type of json:
x is json <description="myjsonfile.node.x.y.z"> (or DnD the description node into the code editor)

Next you get all the IDE features on that definition.
The same works for XML by the way (Since V16 I believe).


Peter Holemans

Edited 1 time(s). Last edit at 05/04/2021 08:52AM by PeHoBe.
Thank you for the clarifications, Peter!

BTW, I also found this link in case someone is interested;



Your Email:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.