# 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. |

Example: Valid and invalid chart expressions

| Example | Result |
| --- | --- |
| `JsonGet( '{"a":{"xyz":"XYZ"},"b":[123,"abc","ABC"]}', '' )` | Returns `{"a":{"xyz":"XYZ"},"b":[123,"abc","ABC"]}` |
| `JsonGet( '{"a":{"xyz":"XYZ"},"b":[123,"abc","ABC"]}', '/a' )` | Returns `{"xyz":"XYZ"}` |
| `JsonGet( '{"a":{"xyz":"XYZ"},"b":[123,"abc","ABC"]}', '/a/xyz' )` | Returns `"XYZ"` |
| `JsonGet( '{"a":{"xyz":"XYZ"},"b":[123,"abc","ABC"]}', '/b' )` | Returns `[123,"abc","ABC"]` |
| `JsonGet( '{"a":{"xyz":"XYZ"},"b":[123,"abc","ABC"]}', '/b/0' )` | Returns `123` |
| `JsonGet( '{"a":{"xyz":"XYZ"},"b":[123,"abc","ABC"]}', '/b/1' )` | Returns `abc` |
| `JsonGet( '{"a":{"xyz":"XYZ"},"b":[123,"abc","ABC"]}', '/b/2' )` | Returns `ABC` |
| `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/May2025/Subsystems/Hub/Content/Sense_Hub/Scripting/StringFunctions/IsJson.htm)

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