util.JSON class is used to convert the values of program variable values to/from the JSON string in order to interface with other software based on the JSON format.
This program variable can be of STRING, RECORD, or DYNAMIC ARRAY data type.
util.JSON class cannot be used for modifying JSON elements. JSON elements are modified and manipulated with util.JSONObject and util.JSONArray classes.
method |
description and examples |
parses a JSON string into separate values and fills the corresponding program variable with them:
DEFINE js STRING DEFINE cust_rec RECORD ... CALL util.JSON.parse(js, cust_rec)
|
|
turns a record variable into a flat JSON string:
DEFINE js STRING DEFINE cust_rec RECORD ... LET js = util.JSON.stringify(cust_rec)
|
|
formats and indents data as a JSON string:
DISPLAY util.JSON.format(js)
|
|
suggests a record structure that can hold the given JSON string:
DEFINE js STRING ... DISPLAY util.JSON.proposeType(js)
|