π¬JSON Extractor Block
Extract specific values from JSON and expose them as variables
Last updated
Extract specific values from JSON and expose them as variables
Last updated
Advanced/Experimental Contact us or join Discord to report issues
Extract specific data value from JSON, for example from a WebFetcher or Text Generator block.
Paste your JSON into the "Value" input, or more usefully, use a variable to another block that returns JSON.
You can use a simple dot-notation syntax to fetch a specific field from a JSON response.
Here's an example using this JSON:
This is the name of the variable that will hold the data. You can use the variable as {blockname.outputname}
in other blocks.
Use the JSON Path 0.name
to extract the name
property of the first object, "Heavy Metal Covers". Note that counting starts at 0 in arrays, so the first item is 0, the second is 1.
At the moment, only text can be extracted from JSON. Let us know in Discord if you have other use cases.
If the data isn't found in the JSON, this value will be used. This can also be a variable, if you want to live dangerously.
In another block, you can see the variables being available as {json1.id}
and {json1.name}
.