“Spreadsheet to JSON” allows you to convert a table like data (e.g. a CSV file) to its corresponding JSON format. JSONs are very easy to use in code steps.

How to use Convert a spreadsheet to JSON

Add the component

Add the Spreadsheet to JSON converter step to your Tool (check how to get started with creating a tool). Spreadsheet to JSON

File URL

A “Spreadsheet to JSON” converter requires a file as an input. If your file is publicly accessible on the web (i.e. with no authentication or sign-up requirement), simply provide the URL directly or as a text input. Otherwise, you will need to add a File-to-URL input. In either situation, use the {{variable name}} to provide the data to the converter.

Spreadsheet to JSON

Follow the links below for more information about

Access the step output

The output is a dictionary with a key rows.

  • spreadsheet_to_json[rows] is a list containing as many rows as included in the uploaded file.
  • Each row is a dictionary representing one row of data (i.e. keys are column headers in the uploaded spreadsheet).

Below you can see samples where the default name assigned to the step spreadsheet_to_json is used. Note that a step name is different from the step title. Step titles can be found on the top left of steps. A step name is shown on the bottom left, in smaller font and highlighted green.

spreadsheet_to_json.rows
spreadsheet_to_json.rows[0]

Common errors

Unsupported file type

An error similar to the one noted below indicates that the provided input is not a valid spreadsheet.

Error:
Unsupported file type: