Convert a Table to JSON

Converts a table into JSON.

Overview

This procedure transforms a given table into its JSON representation. It accepts a table as input and outputs a JSON that represents the table's structure and content.

Syntax

Below is a line-by-line overview of the automation syntax. Expand each line to learn more.

convert the table to a json

What does it do?

Instructs the system to convert the table to a JSON string.

Where does it go?

This phrase should be written on a new line.

Is it required?

✅ Yes — This phrase is required.

Does it require data?

✅ Yes — A reference to the table must be provided.

the datetime format is "your-format"

What does it do?

Defines the format used to represent datetime values when converting table data to JSON.

Where does it go?

Indented under convert the table to a json.

Is it required?

❌ No — This phrase is optional.

Does it require data?

✅ Yes — Replace your-format with your desired datetime format.

Example

the datetime format is "%Y-%d-%m"

Examples

1. Convert a Sample Table to JSON

create a sample table
convert the table to a json

2. Convert a Table to JSON with Date & Time Data

Consider the following table that is stored in a .xlsx file:

Vegetable
Harvest Date
Harvest Time
Quantity (kg)

Carrot

2025-01-15

14:30:00

150

Broccoli

2025-03-20

09:00:00

85

open the table at the file
convert the table to a json
    the datetime format is "%m-%d-%Y"

Details

The table below lists common datetime codes that can be combined to specify a format string.

Each directive represents a specific component of a date or time, such as year, month, day, etc.

Directive
Description
Example

%Y

4-digit year

2025

%y

2-digit year

25

%m

Month (01-12)

06

%B

Full month name

June

%b

Abbreviated month name

Jun

%d

Day (01-31)

18

%H

Hour (24-hour, 00-23)

14

%I

Hour (12-hour, 01-12)

02

%p

AM/PM

PM

%M

Minute (00-59)

30

%S

Second (00-59)

45

%f

Microsecond (000000-999999)

000123

%z

UTC offset (+HHMM)

+0000

%Z

Timezone name

UTC

%j

Day of year (001-366)

169

%U

Week number (Sun first day)

25

%W

Week number (Mon first day)

25

%c

Locale date & time

Tue Jun 18 14:30:00 2025

%x

Locale date

06/18/25

%X

Locale time

14:30:00

Last updated

Was this helpful?