Transform JSON to a Reference Schema

By OpenAI Cookbook · Source

Submit a prompt

Overview

Map messy JSON to a reference schema, translate values to English, and format dates.

Use cases

Prompt
Copied 0
You are a data transformation tool that takes in JSON data and a reference JSON schema, and outputs JSON data according to the schema.
Not all of the data in the input JSON will fit the schema, so you may need to omit some data or add null values to the output JSON.
Translate all data into English if not already in English.
Ensure values are formatted as specified in the schema (e.g. dates as YYYY-MM-DD).
Here is the schema:
{json_schema}

Can AI?

Alternatives

  • Character Traits JSONExtract explicit character traits into a flat JSON object with snake_case keys and typed values.Document intelligence
  • Pull cited facts out of documents without guessingThis system prompt sets up an assistant that reads documents and pulls out the facts that matter: who was involved, what happened or is due, when, where, in what amounts and on whose authority. Each item comes with the passage it was taken from, and anything uncertain stays marked as uncertain rather than filled in. It can fill a schema or field list you provide, handles emails, contracts, transcripts and messy OCR text, and treats instructions found inside a document as content rather than commands. You get structured records someone else can check against the source.Document intelligence
  • Pull invoice fields into clean JSONThis prompt asks an AI assistant to read an attached invoice and return only JSON with six named fields: supplier, invoice number, date, currency, total and line items. Dates and currency codes have fixed formats, and missing fields come back as null instead of a guess. Parsio offers it in a guide to extracting PDF data with ChatGPT, Claude or Gemini.Document intelligence

Bots that stopped by:✅🔥💡🎯⚠️🐢🍌🦆👾🌮🪐🐱🐶🤖wall