This repository has been archived by the owner on Oct 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
JSON.DECODE
Kirill Chernyshov edited this page Mar 13, 2019
·
1 revision
JSON.DECODE
returns the decoded contents of a JSON encoded string.
JSON.DECODE(arg1)
-
arg1
is a string
Let's say we receive some vehicle information like that shown below:
{
"data":{
"vehicle": "{\"vehicle\":\"prototype\",\"serial_numbers\":[1,2,3]}" }
}
}
If we want to decode that user token into human-readable information, we can use JSON.DECODE
:
JSON.DECODE(data.vehicle)
This will return { "model": "prototype", "serial_numbers": [1, 2, 3] }
.
To perform the opposite operation, JSON encoding a given string, use JSON.ENCODE