Data Forge

ScopeRoot
Script
Write JavaScript here… (remember to return a value)
Loading editor…
Input
1
Output
Run a preview to see the output JSON.

Docs

  1. Your script is a JavaScript function body (strict mode): you can write any JS statements.
  2. `data` is a deep-cloned snapshot of the current table scope.
  3. Click Preview to test; click Apply to write the result back to the table scope.
  4. Return a JSON-serializable value (object/array/string/number/boolean/null). Very large outputs may be truncated in Preview.
Quick hints
  • `data` is the current table JSON.
  • `ctx.path` is the current JSON path.
  • Use `ctx.clone/pick/omit/flatten/unflatten` for common tasks.
AI assistant
  • Click the AI icon in the Script panel to open the assistant.
  • Describe your goal (e.g. remove empty values, convert key case, keep only a few fields).
  • Insert the draft script, then Preview/Apply — your data is processed locally in your browser.
  • Privacy: AI drafts use DeepSeek and send your prompt + current script. Avoid pasting secrets.
Example prompts

Related JSON tools

  • Switch between tools to validate, format, or convert your data seamlessly.
  • All tools process data locally in your browser for security and speed.

Frequently Asked Questions

Execution model

Your script is a JavaScript function body (strict mode): you can write any JS statements. `data` is a deep-cloned snapshot of the current table scope. Click Preview to test; click Apply to write the result back to the table scope. Return a JSON-serializable value (object/array/string/number/boolean/null). Very large outputs may be truncated in Preview.

Helper API (`ctx`)

Deep-clone any JSON value (uses structuredClone when available). Keep only selected keys from an object: `ctx.pick(obj, ["a","b"])`. Remove keys from an object: `ctx.omit(obj, ["password","token"])`. Flatten nested objects to dotted keys: `ctx.flatten(obj, ".")`. Build a nested object from dotted keys: `ctx.unflatten(flat, ".")`. Note: `unflatten` returns plain objects; if you need arrays, write a custom converter.

AI assistant

Click the AI icon in the Script panel to open the assistant. Describe your goal (e.g. remove empty values, convert key case, keep only a few fields). Insert the draft script, then Preview/Apply — your data is processed locally in your browser. Privacy: AI drafts use DeepSeek and send your prompt + current script. Avoid pasting secrets.

Troubleshooting

If Preview says “returned undefined”, make sure the script ends with `return ...`. If Preview says “not serializable”, remove circular references / functions / BigInt values. To transform the whole document, select the Root node first, then run the transform.

Runs locally (AI optional)

Preview/Apply runs in your browser on your data. The AI assistant can draft scripts via DeepSeek (prompt + current script). Avoid pasting secrets or running untrusted code.