Working with Structured Data (JSON)
Learn how to understand, manipulate, and apply structured data (JSON) in MindStudio workflows
Last updated
Learn how to understand, manipulate, and apply structured data (JSON) in MindStudio workflows
Last updated
JSON (JavaScript Object Notation) is a powerful and widely used format for storing and exchanging structured data. In MindStudio, understanding how to parse, generate, and utilize JSON is essential for building flexible and powerful AI workflows.
JSON is a structured data format made up of key-value pairs. Each key is a string (in quotes), and its associated value can be:
A string ("Alice"
)
A number (30
)
A boolean (true
)
An array (["user", "admin"]
)
Another object ({"age": 30, "active": true}
)
JSON also supports nesting, allowing you to build complex hierarchies of data.
All keys must be strings (in double quotes).
Key-value pairs must be comma-separated.
Do not include a trailing comma at the end of the last key-value pair.
Many blocks, like Search Google News, return data as JSON. This allows you to access structured results, such as article titles, links, and thumbnails.
You can:
Display the full JSON
Extract specific values using path expressions
Iterate through lists using each
blocks
To get a specific value from JSON, use the JSON path:
This extracts the title
of the first article from the GoogleNews
variable.
Use the #each
tag to loop through arrays in JSON:
This will render each article's title, link, and thumbnail using Markdown formatting.
You can use the Generate Text block to ask AI to return structured JSON. For example, extracting all URLs from search results:
Use an output schema to define the format and simplify complex JSON into more usable lists.
JSON can also be applied to generate HTML pages dynamically using the Generate Asset block. You can:
Iterate over content sections
Conditionally render data like headings, key takeaways, and entities
Use extracted structured data to build full HTML pages for summaries or reports
Example usage:
Extract structured information from a Verge article
Use that data to populate an HTML summary page
Present it with images, headlines, and lists using embedded JSON paths
Understanding JSON enables you to:
Parse and manipulate structured responses
Extract only the values you need
Iterate through complex arrays
Generate clean structured output from unstructured content
Build advanced outputs like HTML templates dynamically
Once you master JSON in MindStudio, you'll be able to build significantly more advanced and powerful agents with flexible output formatting and robust data handling.