To JSON
Convert an object to a JSON representation.
Parameters
| Name | Description | Accepted Values | Default | Required |
|---|---|---|---|---|
| I/O | ||||
input | Name of the input column. | string, integer, array | — | Yes |
output | Name of the output column. If omitted, the input column will be overwritten. | string, array, null | null | No |
| Formatting | ||||
ensure_ascii | If true, non-ASCII characters will be escaped. Default is false. | boolean | false | No |
indent | If 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_keys | If sort_keys is true (defaults to False), then the output of dictionaries will be sorted by key. | boolean | — | No |
| Conditions | ||||
if | Condition that determines whether the wrangle runs as a whole. Recipe variables may be referenced with ${variable}. | string | — | No |
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 |
Examples
wrangles:
- convert.to_json:
input: column
output: new column
| column |
|---|
['a', 'python', 'list'] |
{'python': 'dict'} |
| new column |
|---|
["a","python","list"] |
{"python":"dict"} |
Access
| Requirement | Value |
|---|---|
| AI-powered | No |
| Requires WrangleWorks account | No |
| Requires subscription | No |
| Requires external API key | No |
Technical details
| Field | Value |
|---|---|
| Catalog ID | 10 |
| Catalog key | convert.to_json |
| Recipe key | convert.to_json |
| Catalog status | active |
| Lifecycle status | active |
| Recipe Writer eligible | Yes |
| Namespace | convert |
| Documentation group | convert |
| Aliases | None |
| Runtime symbol | wrangles.recipe_wrangles.convert.to_json |
| Legacy UUID | 94e54eb7-2b8c-4047-89d0-fb5d16baf396 |
Sources