Transform JSON to a Reference Schema

OpenAI Cookbook

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
  • Email Address ExtractionCopy email addresses from text exactly, returning one address per line or N/A when none appear.Document intelligence