Get Rows Sorted by Column

This block is an iterator. Learn more about iterators.

Get all rows in a database sorted by up to 3 columns.

If you are unsure how to use Databases, we have a tutorial that goes over them here.

What does it do?

The Get Rows Sorted by Column block allows you to retrieve all the rows in a database sorted by up to 3 specified column values with selectable sort order and iterate over them.

Example of Get Rows Sorted by Column Block


Inputs

Database Required

Provide the name of the database to use for this block.

The database must exist on the current bot.

Example: my_database

Sort Column Required

Provide the name of a column in the selected database.

Make sure that the column exists in the selected database.

Example: my_column

Sort Order Required

Provide the order to sort the results by.

Ascending will sort results (1, 2, 3). Descending will sort results (3, 2, 1).

Example: Ascending

Sort Column 2

Provide the name of a column in the selected database.

Make sure that the column exists in the selected database.

Example: my_column

Sort Order 2

Provide the order to sort the results by.

Ascending will sort results (1, 2, 3). Descending will sort results (3, 2, 1).

Example: Ascending

Sort Column 3

Provide the name of a column in the selected database.

Make sure that the column exists in the selected database.

Example: my_column

Sort Order 3

Provide the order to sort the results by.

Ascending will sort results (1, 2, 3). Descending will sort results (3, 2, 1).

Example: Ascending

Outputs

Row ID iterator

The Row ID of the current iteration’s row.

Example: abcdef12-3456-7890-abcd-ef1234567890

Iteration Number iterator

The current iteration expressed as a number.

Example: 5

Total Iterations

The total number of iterations that this loop will complete

Example: 5

Created At (Unix) iterator

The Unix timestamp of when the current iteration’s row was created.

Example: 1731886315

Updated At (Unix) iterator

The Unix timestamp of the last time the current iteration’s row was updated.

Example: 1731886315