Early Access: The content on this website is provided for informational purposes only in connection with pre-General Availability Qlik Products.
All content is subject to change and is provided without warranty.
Skip to main content Skip to complementary content

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. 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":{"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
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).

Example - JsonGet fundamentals

See also:

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!