Working with JSON
Learn about structured data with JSON.
What Is JSON in MindStudio?
JSON (JavaScript Object Notation) is a lightweight data-interchange format
JSON lets you structure AI output as key–value pairs, making it easy to parse, display, or export to other systems.
Represents data as nested objects and arrays
Ideal for:
Structured reports or catalogs
Data exports (to CSV, spreadsheets, databases)
Downstream logic (conditionals, integrations)
JSON Fundamentals Cheat-Sheet
{ … }
Object (holds key–value pairs)
"key": value,
Key–value pair (separated by commas)
"string"
String (always in quotes)
123
Number (no quotes)
true
/false
Boolean
[ … ]
Array (ordered list of items)
Enable JSON Output
Open your Generate Text block.
Under Output Schema, select JSON instead of Text. A Sample Output editor appears—this is where you define your JSON template.

Define Your JSON Template
In Sample Output, sketch the shape of your response:
Keys (e.g.,
title
,body
) define fields your AI will fill.Values can be placeholders or examples guiding the model’s output.
Empty strings (
""
) let the AI choose content freely.
Extracting a Value from a JSON Structure
MindStudio provides tools for extracting specific values from JSON objects using the JSON Path syntax and the get
helper. This allows workflows to handle and manipulate structured data with precision, making them more dynamic and adaptable.
get
Helper - Query JSON Variables
get
Helper - Query JSON VariablesThe get
helper allows you to query JSON variables for specific values using JSON Path expressions. This feature is especially useful when working with nested or complex JSON structures.
Syntax:
Example 1: Extract a Nested Value:
Given the following JSON assigned to myJsonVariable
:
Use this to extract the email address:
Output: [email protected]
Example 2: Extract the First Item in an Array:
Given the following JSON:
Use this to extract the name of the first item:
Output: Foo
Example 3: Extract Multiple Values:
JSON Path also allows for querying multiple elements. Given the following JSON:
Output: ["Foo", "Bar"]
Best Practices When Extracting JSON
Use a JSON Path Tester: Tools like JSONPath Online Evaluator can help you refine and test your JSON Path queries.
Validate JSON Structure: Ensure your variable contains valid JSON data before attempting to extract values.
Handle Missing Values: Include fallback logic in your workflow to handle cases where the expected path does not exist in the JSON.
Last updated