๐Ÿ”ฌJSON Extractor Block

Extract specific values from JSON and expose them as variables

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.

JSON Data

Paste your JSON into the "Value" input, or more usefully, use a variable to another block that returns JSON.

Choose data to extract

You can use a simple dot-notation syntax to fetch a specific field from a JSON response.

Here's an example using this JSON:

[
  {
    "id": "clgh1vxtu0011mo081dplq3xs",
    "name": "Heavy Metal Covers",
    "imageUrl": null,
    "description": "A new glif that performs some truly magical stuff"
  }
]

Output name

This is the name of the variable that will hold the data. You can use the variable as {blockname.outputname} in other blocks.

JSON Path

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.

Fallback

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.

Using the variables

In another block, you can see the variables being available as {json1.id} and {json1.name}.

Last updated