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"

firstNamelastNamedobyearsOfExperiencesmoker
JohnDoe31/1/19923true
MarryPoppins13/12/19915false

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 .