Insert a Row

Inserts a row into the table with given data.

Overview

This procedure inserts a row into the table with given data at the specified row number.

Input Concepts

Concept
Type
Description
Default
Required

row

Any

The data for the row to be inserted. If a reference to a row is not provided, the data for each column must be specified individually. See Example 1 for details.

No default

No

row number

int

The row number to insert the new row at.

If not provided, the row will be inserted at the end of the table.

No

Note: Table rows are numbered starting with the number 1.

Output Concepts

Concept
Description

table

The updated table with the new row inserted.

Examples

For the examples below, the table refers to the following table:

Name
Color
Type

Carrot

Orange

Root

Spinach

Green

Leafy

Potato

Brown

Root

1. Insert a Row Without Specifying Row Number

To insert a new row into the table without providing a row number or a reference to a row, we specify data for all the columns in the table.

insert a row in the table where 
    the Name is "Beet"
    the Color is "Red"
    the Type is "Root"

2. Insert a Row When Specifying a Row Number

For this example, the row refers to the following row:

Name
Color
Type

Beet

Red

Root

insert the row in the table where
    the row number is 2

Last updated

Was this helpful?