🥞
Glif Docs/Guide
  • Getting Started
    • 👋What is Glif?
    • 💡What can I do with a glif?
      • 🏃Run a glif
      • 🔌Build a glif
      • 🔀Remix a glif
      • 🗣️Comment on a glif
      • 🔳Embed a glif
    • ⚒️How do I build a glif?
      • 📽️Video tutorial: Building a simple image generator
      • 🟰Using variables
    • ⚙️Profile Settings
    • 🪙Credits and Payments
    • ❓FAQs
  • Blocks
    • 🙋Inputs
      • ✍️Text Input Block
      • 🖼️Image Input Block
      • 📋Multipick Block
    • 🪄Generators
      • 📃Text Block
      • 🖼️Image Block
      • ➡️Image to Text Block
        • Florence2Sam2Segmenter
    • 🧰Tools
      • 🔀Text Combiner Block
      • 🔬JSON Extractor Block
      • 🎬Videokit Tools
    • 💅Styling
      • 🎨HTML Block
      • 🖼️Canvas Block
    • 🧑‍🔬Advanced/Experimental
      • 🎙️Audio Input Block
      • ↔️Glif Block
      • 🌐Web Fetcher Block
      • 🔊Audio Spell
      • 🧱ComfyUI Block
      • 📡Audio to Text Block
      • 🎥Video Input Block
      • 🔧JSON Repair Block
  • Apps
    • 🎨Glif It! Browser Extension
  • Glif University
    • 🎥Video Tutorials
      • 🐲How To: D&D Character Sheet Generator
      • 🧠How To: Expanding Brain Meme Generator
      • 🦑How To: Occult Memelord Generator
      • 🥸How To: InstantID Portrait Restyle Glif
      • 🕺How To: Style and Pose a Character with InstantID + Controlnet
      • 😱How To: Create a Simple Cartoon Portrait Animation Glif (LivePortrait + Custom Blocks)
      • 👗How to Create a Clothing Restyler App (IP Adapter, ControlNet + GPT Vision)
      • 🤡How to Create a 4+ Panel Storyboard/Comic (Flux Schnell)
      • 🎂How to Create a Recipe Generator with Accompanying Pictures
      • How to Use JasperAI Depth Controlnet on Flux Dev
      • 🦸‍♂️How to Make a Consistent Comic Panel Generator
    • 🧑‍🏫Prompt Engineering 101
    • 🖼️ControlNet
    • 📚AI Glossary
  • API - for Developers
    • ⚡Running glifs via the API
    • 🤖Using AI Assistants to build with the Glif API
    • 📙Reading & writing data via the API
    • 🗾Glif Graph JSON Schema
    • 📫Embed player & custom webpages
    • 📫Sample code
    • ❓What can I make with the Glif API?
      • Browser Extensions
      • Discord Bots
      • Games
      • Social Media Bots
      • Experimental Projects
  • Policies
    • 👨‍👩‍👧‍👦Community Guidelines
  • Programs
    • 🖼️Loradex Trainer Program
  • Community Resources
    • 🧑‍🤝‍🧑Resources Created by Glif Community Members
  • Contact Us
    • 📣Send us your feedback
    • 🚔Information for law enforcement
Powered by GitBook
On this page
  • JSON Data
  • Choose data to extract
  • Using the variables
  1. Blocks
  2. Tools

JSON Extractor Block

Extract specific values from JSON and expose them as variables

PreviousText Combiner BlockNextVideokit Tools

Last updated 11 months ago

Advanced/Experimental or 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}.

🧰
🔬
Contact us
join Discord