json_decode
Reads JSON text into a value: a record, a list, a number, text, true, false or null. Text that is not JSON gives null. The fields of a record it returns are read with `get_field`, `has_field` and `keys`, or with the dot (`r.name`) when the record came from this function on the device.
Runs on: either side: the compiler places the statement that calls it where the values it uses live.
Format:
json_decode(text)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| text | string | the JSON text |
Returned Value:
| Type | Description |
|---|---|
| mixed | the value, or null when the text is not JSON |
Examples
items = json_decode(order.items_json)