JsonPath

The JsonPath function traverses a JSON string and returns a specified value from within the JSON text.  The value returned is returned as a string.

Syntax

JsonPath(<string>, <json path>)

Return Type

String

Details

Connect uses the JSON path syntax to locate an attribute or array value from with the JSON hierarchy specified.  The input is a JSON object in string form.  Any specified attribute or array element can be retried using the JSON path syntax.

Examples

select JsonPath('{"a":"foo", "b":["zero", "one"]}', '$.a');

select JsonPath('{"a":"foo", "b":["zero", "one"]}', '$.b[1]');

Related Functions