Query JSON

Extracts a single matched value from a JSON string using a path expression (see that parameter's description for its syntax). If no matches are found, an empty string is returned. If multiple values are matched, the first is returned. To read all matches, use the Query JSON All node.

This is useful in conjunction with the nodes: • String to Number: convert numeric query results to numbers. • String ValueEquals: convert "true", "false", or "null" query results to bools.

Interface

Inputs

ParameterDetailsPossible Types
JSON

The JSON string to extract a value from.

Primary Input

String
Path

Determines which contained value to extract from within the JSON.

The path syntax is like JavaScript's accessor syntax that follows an array/object value. It also supports negative indexing to count backwards from the end. Additionally, [] accesses all array and object values instead of just one.

Examples:

Use [2] or [-1] to get the last value, and [1] or [-2] for the middle value, of ["a", "b", "c"].

Use .size or ["size"] to get the size property of { "size": 10 }. The latter form is required if the key contains spaces or special characters like ["this key with spaces!"].

Use chained accessors like .fonts[0].name to query deeper.

Use the [] accessor to query all elements, like .fonts[].weights[] to get every weight of every font.

Default: ""

String
Unquote Strings

Strips the surrounding double quotes from string values, returning the raw text. Other types are never wrapped in quotes.

Default: true

bool

Outputs

ProductDetailsPossible Types
Result

The value produced by the node operation.

Primary Output

String