JSON Import

Load a JSON file from disk and extract values with a JSONPath expression.

What it does

JSON Import reads a local JSON file and pulls values out of it with a JSONPath expression. Point Path at a file, then use JSONPath to select the part of the document you want.

A single read of the file produces several outputs at once: the matched value, that value as a number, an array of numbers if the path matches a list, a table of rows if the path matches an array of objects, the raw file contents, and an error message.

When to use it

ParameterTypeDefault
pathString""
json_pathString"$"

Gotchas

Number outputs 0.0 when the matched value is not numeric. Check Error rather than reading a zero as data that was actually zero.

Worked example

  1. Add a JSON Import node and set Path to your JSON file.

  2. Set JSONPath to target the data you want, e.g. $.readings[*].temperature.

  3. Wire Values into a node that takes a number array, or wire Table into a Collection input if your data is a list of objects.

  4. Check Error to confirm the file parsed before trusting the other outputs.

See also

CSV Import · File IO · Web Fetch · Numbers, signals & audio