The JSON Input Editor
Last updated on 16 Aug 2024
Overview
This input editor accepts a valid JSON object and is a component in both the JSONata Studio Playground and JSONata Studio Book.
It has several useful features allowing you to:
- convert Excel to JSON
- format JSON
- copy JSON to the clipboard
Excel to JSON conversion
To import an Excel spreadsheet as JSON, press the icon button and select an .xlsx
file to upload.
The information in each sheet will be stored in a separate object under a key named as the sheet, and the cell data on the first row of each sheet will become the property keys of the respective object.
Cell data containing a date will be converted to an ISO 8601 date string.
For example, an Excel file with one sheet named "Sheet1"
firstName | lastName | dob | yearsOfExperience | smoker |
---|---|---|---|---|
John | Doe | 31/1/1992 | 3 | true |
Marry | Poppins | 13/12/1991 | 5 | false |
will be converted to
{
"Sheet1": [
{
"firstName": "John",
"lastName": "Doe",
"dob": "1992-01-31T00:00:00.000Z",
"yearsOfExperience": 3,
"smoker": true
},
{
"firstName": "Marry",
"lastName": "Poppins",
"dob": "1992-12-13T00:00:00.000Z",
"yearsOfExperience": 5,
"smoker": false
}
]
}
Format
To give the JSON input a consistent look, press the icon button .
This will add line breaks after each [
and {
, and a consistent indentation of 2 spaces.
Copy
To copy the JSON input including its formatting to the clipboard, press the icon button .