JSON Files
4 nodes
On this page 4
Parse JSON
FunctionA table from JSON text - a web API's response, or records typed into the node.
Signature
ParseJSON(JSON: Text) -> Table
Table ParseJSON(string json = "[{\"Name\": \"Alpha\", \"Value\": 1}, {\"Name\": \"Beta\", \"Value\": 2}]")Parameters
| name | type | default | description |
|---|---|---|---|
| JSON | Text | [{"Name": "Alpha", "Value": 1}, {"Name": "Bet... | The JSON text. |
Returns
| Table | Table |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- JSON Files
- Package
- Data Analytics
Read JSON
FunctionA table from a JSON file: an array of objects is a row per object and a column per key; an object holding one such array, as an API response does, is read the same way; an object of equal-length arrays is a column per array. Nested objects become dotted column names.
Signature
ReadJSON(path: Text) -> Table
Table ReadJSON(string path)
Parameters
| name | type | default | description |
|---|---|---|---|
| path | Text | — | The file. |
Returns
| Table | Table |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- JSON Files
- Package
- Data Analytics
To JSON
FunctionA table as JSON text: an array of records, one object per row.
Signature
ToJSON(table: Table, indented: Truth) -> Text
string ToJSON(Table table, bool indented = false)
Parameters
| name | type | default | description |
|---|---|---|---|
| table | Table | — | The table. |
| indented | Truth | False | Whether to lay the JSON out on several lines. |
Returns
| JSON | Text |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- JSON Files
- Package
- Data Analytics
Write JSON
FunctionWrites a table to a JSON file as an array of records, one object per row, and gives back the file's path.
Signature
WriteJSON(table: Table, path: Text, indented: Truth) -> Text
string WriteJSON(Table table, string path, bool indented = true)
Parameters
| name | type | default | description |
|---|---|---|---|
| table | Table | — | The table. |
| path | Text | — | The file to write; its folder is created if need be. |
| indented | Truth | True | Whether to lay the JSON out on several lines. |
Returns
| Path | Text |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- JSON Files
- Package
- Data Analytics