json_encode
Gives the JSON text of a value: a record, a list, a number, text, true, false or null. A cloud object is written as a record of its stored fields. Use it to keep a record or a list in a text field of a cloud object; `json_decode` reads it back.
Runs on: either side: the compiler places the statement that calls it where the values it uses live.
Format:
json_encode(value)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | mixed | the value to write |
Returned Value:
| Type | Description |
|---|---|
| string | the JSON text |
Examples
order.items_json = json_encode(items)