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
Parameters driven from a config file, a saved preset, or an exported dataset on disk
A table of rows from a JSON array, with Table wired into anything that takes a Collection
A load check before using the data, by reading Error
The whole file as text for further parsing with an Expression, or for display as-is, from Raw
| Parameter | Type | Default |
|---|---|---|
path | String | "" |
json_path | String | "$" |
Gotchas
JSONPath defaults to
$, the whole document. Narrow it to the part you need, for example$.data[*].value, so Value and Number land on the right piece of data.Table only fills in when the JSONPath matches an array of objects. For a flat array of numbers, read Values instead.
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
Add a JSON Import node and set Path to your JSON file.
Set JSONPath to target the data you want, e.g.
$.readings[*].temperature.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.
Check Error to confirm the file parsed before trusting the other outputs.