Working with Properties and Elements

There are several functions to get property values from a JSON object or element values from a JSON array and to set these values. The functions differ in the data type of the property or element they want to get or set.

Get, set, and create properties

Note: The name of a property is case sensitive.

JsonGet … Property(handle : in number, 
                   property : in string, 
                   value : out … ): boolean;
JsonSet … Property(handle : in number, 
                   property : in string, 
                   value : in … ): boolean;

In case the requested property does not exist in the JSON object, nothing happens and the function JsonGet ... Property returns false. When calling the function JsonSet ... Property with a not existing property name, the property will be created.

Get, set, and create elements

Note: The index of the array is zero terminated.

JsonArrayGet … Element (handle : in number, 
                       	index : in number, 
                       	value : out … ): boolean;
JsonArraySet … Element (handle : in number, 
                       	index : in number, 
                       	value : in … ): boolean;

In case the requested element does not exist in the JSON object, nothing happens and the function JsonArrayGet ... Element returns false. When calling the function JsonArraySet ... Element with a not existing index, the value will be appended to the array. Therefore there is no guarantee that the index of the new element is equal to the specified index.