The
JS.setValueFromJson function sets the value of a JavaScript variable or property from
JSON representation passed to the function as the string expression
json. The JSON is converted to a value or object using
JSON.parse. This is a useful way to transfer data from CSPro logic to JavaScript if the data cannot be represented by a CSPro object that can be handled by the
JS.setValue function. This function can be used to create new variables or properties, or to modify existing ones.
The function returns a logical value of 1 (
true) if the JSON is valid and the variable or property is successfully set. If JSON parsing or JavaScript evaluation ends in an uncaught exception, the function returns 0 (
false) and displays an error message.