JSON Column
The JSON column type lets you generate structured data like objects or lists directly in a cell. Content can be created using code (via the Python Tool) or AI (via the LLM Tool), depending on your data source and the type of reasoning you want to apply.
Benefits of JSON Columns
- Enforce a structured format for the object represented in the cell
- Store multiple fields in one cell: Using a JSON object to represent structured records avoids splitting them across separate columns.
- Interoperability: Easily export structured content to external systems or use it as an input for other processing in Phacet.
💡 Expert Tip: Optimize AI Credit Usage
Using JSON as the output format for AI Tool helps reduce credit usage, by limiting the number of times a content is read to identify data.
How to Set Up a JSON Column
Step 1 : Add a column and configure its schema
- Add a column
- Select JSON as the column type
- Select the tool used to generate the content
- Manual
- AI Tool
- Python Tool
- Set the JSON Schema
- Setting a JSON schema is required and defines the structure your JSON data must follow. Without it, the content won't be validated or rendered properly.
- You can define the JSON schema by following the documentation.
- Or you can generate the JSON Schema by asking ChatGPT, to generate the JSON schema based on an exemple of your desired JSON.
Example of instructions given to chatGPT
Generate the JSON SCHEMA for this JSON:
{
"siren_number": "822 250 114",
"company_name": "blcorp",
"head_office_address": "1480 route de vinay, 38210 tullins, france"
}
JSON Schema generated by ChatGPT
Here's the JSON Schema corresponding to your JSON object:
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "CompanyInformation",
"type": "object",
"properties": {
"siren_number": {
"type": "string",
"description": "The 9-digit SIREN number formatted with spaces"
},
"company_name": {
"type": "string",
"description": "The company’s legal name"
},
"head_office_address": {
"type": "string",
"description": "The address of the company's head office"
}
},
"required": ["siren_number", "share_capital", "company_name", "head_office_address"],
"additionalProperties": false
}
Step 2 : Set instructions to generate output
Option 1 - Python Tool
- Set up your Python function in the Instructions field (see our Python Tool article for detailed instruction).
- Make sure that your
main()
function returns a Dict object that respects the JSON Schema you defined above.
ℹ️ The Python tool can be used without limit as it does not consume credits
Option 2 - AI tool : extract structured data using LLM
- The JSON Schema that you defined above is already passed to the AI tool so you don’t need to repeat the instructions.
- the AI tool, will understand your JSON schema to interpret the data to extract, in particular it will look at the
properties name
,type
anddescriptions
to understand what it needs to extract and the expected output format format

- In the instructions you can reference the input data usually stored in a file Column using @name of the file column from which you want to extract the information
Example of instructions for the AI tool to extract information from documents
Extract the information from @name_of_file_column
Tip - Facilitate review with the Python Tool
You can pick individual elements from the JSON result and display them in dedicated columns by using simple Python functions. This will allow you to review them faster.

Columns Avenant / Date Avenant & Type de contrat are extracted from the JSON Column using Python
How to set up your Python function to perform extraction
- Create a Text Column
- Select the Python Tool
- Enter a Python function to extract an individual item
- Copy and Paste the Python function below in your column’s instruction field
- Replace the parameters, column name and field to extract with the right references in your Phacet
- Make sure you reference the right column name and fields
- Click on Generate Values
⚒️ PYTHON function template
#---- PARAMS -----#
name_info = @name_of_file_column
# 1. replace name_info with a name that represents the info you want to extract
# 2. replace @name_of_file_column by the column name where your JSON is located
#---- END PARAMS -----#
#---- MAIN FUNCTION ----#
def main():
return name_info["field_to_extract"]
# 3. name_info should be replaced by the name chosen in step 1.
# 4. replace field_to_extract by the field name you want to extract from your JSON Schema
#---- END MAIN FUNCTION ----#
You can use that function directly in the instructions field

💡 Example : We want to extract the company name from the following JSON
{
"siren_number": "822 250 114",
"company_name": "blcorp",
"head_office_address": "1480 route de vinay, 38210 tullins, france"
}
# Column name : company_info
👇🏼 Python function to execute
#---- PARAMS -----#
company_info = @company_info
#---- END PARAMS -----#
#---- MAIN FUNCTION ----#
def main():
return company_info["company_name"]
#---- END MAIN FUNCTION ----#
Handling errors
JSON columns can fail to render or validate properly when:
-
The returned value is not valid JSON.
Example: returning a string. -
The JSON structure doesn't match the JSON schema
Example: Fields are missing, types are incorrect, or nested formats deviate from what the schema expects.
Debugging tips:
- Use a JSON validator (ChatGPT) to check the syntax before Generating Values
- Start with a small JSON schema, then incrementally add fields.
- Ensure your Python
main()
or AI prompt always returns a dict object with all required fields.
Uses Cases you can address with JSON
- Contract analysis: Extract key legal and commercial information from contract documents using AI, and store the results as structured JSON per row.
- Invoice analysis with matching: Extract structured invoice data (e.g. invoice number, vendor, line items) and match against known reference sources like negotiated pricing or approved purchase orders.
- Investment document extraction: Analyze investment memos or pitch decks using AI Instructions to extract relevant informations. The resulting JSON can be passed to analytics tools or dashboards to support portfolio tracking, pipeline analysis, or market benchmarking.
Updated 14 days ago