Convert JSONs to Table

Converts a specified non-empty JSON array of objects (or single object) into a table.

Overview

Converts a specified non-empty JSON array of objects (or single object) into a table. This is a specialized conversion procedure for JSON data that explicitly creates tables from JSON arrays.

Syntax

convert the jsons to a table

Parameters

  • jsons (required): A JSON array of objects or a single JSON object to be converted into a table.

Returns

A table where:

  • Each object in the array becomes a row

  • Object keys become column names

  • Object values become cell values

Examples

1. Convert Simple JSON Array to Table

the foos is "[ { \"a\": 1, \"b\": 2 }, { \"a\": 10, \"b\": 20 } ]"
the foos is a json
convert the foos to a table

Result: Table with columns "a" and "b"

a
b

1

2

10

20

2. Convert JSON with Nested Objects

Result: Table preserving nested structures

name
val
arr

Obj 0

{"bar": "baz"}

[0, 1, 2]

Obj 1

{"bar": "busy"}

[1, 2, 3]

Obj 2

{"bar": "booze"}

[2, 3, 4]

3. Round-Trip Conversion

Result: Original JSON structure preserved

4. Single JSON Object

Result: Single-row table

name
age
city

Alice

30

NYC

5. Complex JSON from External Source

Result: Table with all fields, None/null values preserved

Last updated

Was this helpful?