# JsonGet - script and chart function

JsonGet() returns the path of a JSON (JavaScript Object Notation) data string. The data must be valid JSON but can contain extra spaces or newlines.

Syntax:

value JsonGet(json, path)

Return data type: dual

Arguments

| Argument | Description |
| --- | --- |
| json | String containing JSON data. |
| path | The path must be specified according to [RFC 6901](https://datatracker.ietf.org/doc/html/rfc6901). This will allow lookup of properties inside JSON data without using complex substring or index functions. |

[](https://help.qlik.com/en-US/sense/Subsystems/Hub/Content/Sense_Hub/Scripting/StringFunctions/JsonGet.htm)

#### Example: Valid JSON and path

| Example | Result |
| --- | --- |
| `JsonGet('{"a":{"foo":"bar"},"b":[123,"abc","ABC"]}', '')` | Returns '{"a":{"foo":"bar"},"b":[123,"abc","ABC"]}' |
| `JsonGet('{"a":{"foo":"bar"},"b":[123,"abc","ABC"]}', '/a')` | Returns '{"foo":"bar"}' |
| `JsonGet('{"a":{"foo":"bar"},"b":[123,"abc","ABC"]}', '/a/foo')` | Returns '"bar"' |
| `JsonGet('{"a":{"foo":"bar"},"b":[123,"abc","ABC"]}', '/b')` | Returns '[123,"abc","ABC"]' |
| `JsonGet('{"a":{"foo":"bar"},"b":[123,"abc","ABC"]}', '/b/0')` | Returns '123' |
| `JsonGet('{"a":{"foo":"bar"},"b":[123,"abc","ABC"]}', '/b/1')` | Returns '"abc"' |
| `JsonGet('{"a":{"foo":"bar"},"b":[123,"abc","ABC"]}', '/b/2')` | Returns '"ABC"' |

[](https://help.qlik.com/en-US/sense/Subsystems/Hub/Content/Sense_Hub/Scripting/StringFunctions/JsonGet.htm)

#### Example: Invalid JSON or path

| Example | Result | Description |
| --- | --- | --- |
| `JsonGet('{"a":"b"}','/b')` | Returns null | The path does not point to a valid part of the JSON data. |
| `JsonGet('{"a"}','/a')` | Returns null | The JSON data is not valid JSON (member "a" does not have a value). |

See also:

* [IsJson - script and chart function](https://help.qlik.com/en-US/sense/November2024/Subsystems/Hub/Content/Sense_Hub/Scripting/StringFunctions/IsJson.htm)

* [JsonSet - script and chart function](https://help.qlik.com/en-US/sense/November2024/Subsystems/Hub/Content/Sense_Hub/Scripting/StringFunctions/JsonSet.htm)