Skip to main content

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 output overwrites 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​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputName, index, or list of columns containing valid JSON text.string, integer, array—Yes
outputName or list of output columns. If omitted, each input column is overwritten.string, arraynullNo
Conditions
whereFilter rows before applying the wrangle using SQL-like criteria, such as column1 = 123 OR column2 = 'abc'.string—No
where_paramsValues used with where for parameterized criteria. Uses SQLite placeholder syntax such as ? or :name.array, object—No
ifCondition that determines whether the wrangle runs as a whole. Recipe variables may be referenced with ${variable}.string—No
Errors
defaultValue returned for empty or invalid JSON. A list may supply one fallback per input column.string, number, array, object, boolean, nullnullNo

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
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID8
Catalog keyconvert.from_json
Recipe keyconvert.from_json
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
Namespaceconvert
Documentation groupconvert
AliasesNone
Runtime symbolwrangles.recipe_wrangles.convert.from_json
Legacy UUIDe370dfcf-b0fe-4c48-8a52-6f34c47e7978

Sources