Convert.FromJSON(JSON)
Converts a properly formatted JSON string back into a Javascript object.
Applies To
Properties and Methods
None
Available
The .FromJSON(JSON) method is available in:
- 16.00.021
- All newer builds
Type
Object
Syntax
Convert.FromJSON(JSON);
Parameters
|
Parameter |
Required |
Description |
|---|---|---|
| JSON | Yes | A string representing a valid JSON object |
Example
var lcInfo = '{"name": "John", "age": 31, "zip": 19468}'; //--valid JSON string
var loInfo = Convert.FromJSON(lcInfo); //--convert from JSON string to object
var lcMsg = 'name: ' + loInfo.name + '\n';
lcMsg += 'age: ' + loInfo.age + '\n';
lcMsg += 'zip: ' + loInfo.zip
Event.Form.MessageBox(lcMsg);
/* Expected System Prompt Display:
name: John
age: 31
zip: 19468
*/