ParseJSON (Initialise)
The ParseJSON function can be used to initialise a string of JSON-structured data stored in a variable. This creates an object in run-time memory based on the data, assigning it a unique Key. The key can then be used to reference the data in other ParseJSON instructions, for example when updating or removing data.
Changes made to the original variable will update the object, and initialising another string using an existing key will cause the older object to be overwritten.
Syntax
ParseJSON( InstructionType, Key, JSONSource );
Parameters
Parameter Name | Type | Description | Optional? | Default Value |
---|---|---|---|---|
InstructionType | Integer OR String | Must be set to either the integer 1 or the string "Initialise". | No | n/a |
Key | String | The key of the intended JSON object. | No | n/a |
JSONSource | Variable Name (no quotes) | The name of the variable to be initialised as an object. | No | n/a |
Output
The function will return "Initialised" if it is the first time the specified key was used, or "Updated" if an existing key was overwritten. If the chosen variable does not contain a valid set of JSON data, the function will return an error.