Skip to main content

To JSON

Convert an object to a JSON representation.

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputName of the input column.string, integer, array—Yes
outputName of the output column. If omitted, the input column will be overwritten.string, array, nullnullNo
Formatting
ensure_asciiIf true, non-ASCII characters will be escaped. Default is false.booleanfalseNo
indentIf indent is a non-negative integer or string, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0, negative, or "" will only insert newlines. None (the default) selects the most compact representation. Using a positive integer indent indents that many spaces per level. If indent is a string (such as '\t'), that string is used to indent each level.string, integer—No
sort_keysIf sort_keys is true (defaults to False), then the output of dictionaries will be sorted by key.boolean—No
Conditions
ifCondition that determines whether the wrangle runs as a whole. Recipe variables may be referenced with ${variable}.string—No
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

Examples​

wrangles:
- convert.to_json:
input: column
output: new column
column
['a', 'python', 'list']
{'python': 'dict'}
new column
["a","python","list"]
{"python":"dict"}
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID10
Catalog keyconvert.to_json
Recipe keyconvert.to_json
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
Namespaceconvert
Documentation groupconvert
AliasesNone
Runtime symbolwrangles.recipe_wrangles.convert.to_json
Legacy UUID94e54eb7-2b8c-4047-89d0-fb5d16baf396

Sources