4D v14.3JSON Parse |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v14.3
JSON Parse
JSON Parse
The JSON Parse command parses the contents of a JSON-formatted string and extracts values that you can store in a 4D field or variable. This command deserializes JSON data; it performs the opposite action of the JSON Stringify command. In jsonString, pass the JSON-formatted string whose contents you want to parse. This string must be formatted correctly, otherwise a parsing error is generated. Note: If you use pointers, you must call the JSON Stringify command before calling JSON Parse. By default, if you omit the type parameter, 4D attempts to convert the value obtained into the type of the variable or field used to store the results (if one is defined). Otherwise, 4D attempts to infer its type. You can also force the type interpretation by passing the type parameter: pass one of the following constants, available in the Field and Variable Types theme:
Notes:
Examples of simple conversions: C_REAL($r) Example of converting date type data: This example shows the combined use of the JSON Stringify and JSON Parse commands: C_TEXT($MyContact) |
PROPERTIES
Product: 4D
HISTORY
SEE ALSO
Field and Variable Types ARTICLE USAGE
4D Language Reference ( 4D v14 R2) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||