JSON.DECODE

JSON.DECODE returns the decoded contents of a JSON encoded string.

Function category: JSON

To perform the opposite operation, JSON encoding a given string, use JSON.ENCODE‚Äč

Syntax

JSON.DECODE(arg1)

Arguments

Description

arg1

A string.

Examples

Example 1: Decode user token to human-readable form

Let's say we receive the following vehicle information:

{
"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 returns the following:

{ "model": "prototype", "serial_numbers": [1, 2, 3] }

.