Convert From JSON
Parse JSON text into lists, objects, scalars, booleans, or null values.
Use convert.from_json when a column contains JSON text that later wrangles
need to treat as structured values.
Behavior
- Each non-fallback value is parsed with Python's JSON parser.
- Omitting
outputoverwrites the input column. - Multiple input columns may share one fallback or use one fallback per input.
- Invalid JSON raises an error unless a non-null fallback is supplied.
- Permissive Python-literal or YAML-like parsing is outside this wrangle's contract.
Parameters
| Name | Description | Accepted Values | Default | Required |
|---|---|---|---|---|
| I/O | ||||
input | Name, index, or list of columns containing valid JSON text. | string, integer, array | — | Yes |
output | Name or list of output columns. If omitted, each input column is overwritten. | string, array | null | No |
| Conditions | ||||
where | Filter rows before applying the wrangle using SQL-like criteria, such as column1 = 123 OR column2 = 'abc'. | string | — | No |
where_params | Values used with where for parameterized criteria. Uses SQLite placeholder syntax such as ? or :name. | array, object | — | No |
if | Condition that determines whether the wrangle runs as a whole. Recipe variables may be referenced with ${variable}. | string | — | No |
| Errors | ||||
default | Value returned for empty or invalid JSON. A list may supply one fallback per input column. | string, number, array, object, boolean, null | null | No |
Examples
wrangles:
- convert.from_json:
input: attributes_json
output: attributes
| attributes_json |
|---|
| {"material":"steel","voltage":18} |
| ["corded","variable speed"] |
| attributes |
|---|
| {"material":"steel","voltage":18} |
| ["corded","variable speed"] |
Access
| Requirement | Value |
|---|---|
| AI-powered | No |
| Requires WrangleWorks account | No |
| Requires subscription | No |
| Requires external API key | No |
Technical details
| Field | Value |
|---|---|
| Catalog ID | 8 |
| Catalog key | convert.from_json |
| Recipe key | convert.from_json |
| Catalog status | active |
| Lifecycle status | active |
| Recipe Writer eligible | Yes |
| Namespace | convert |
| Documentation group | convert |
| Aliases | None |
| Runtime symbol | wrangles.recipe_wrangles.convert.from_json |
| Legacy UUID | e370dfcf-b0fe-4c48-8a52-6f34c47e7978 |
Sources