Get Random Rows by Value

This block is an iterator. Learn more about iterators.

Get a specified number of random rows from a database within a search value in a column.

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

All returned values will be unique, although there may be fewer than the specified number of rows if there are not enough unique rows in the database or due to technical limitations.

What does it do?

The Get Random Rows by Value block allows you to retrieve a specified number of random rows from a database filtered by a specified column value and iterate over them. Example of Get Random Rows by Value


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

Number of Rows Required

The number of rows to get from the database.

Example: 5

Column

The column to search for a row by.

Provide the name of a column in the selected database.

Make sure that the column exists in the selected database.

Example: my_column

Value

Provide a value to look up in the selected database/column.

Example: Example value!

Outputs

Row ID iterator

The Row ID of the current iteration’s random row.

Example: abcdef12-3456-7890-abcd-ef1234567890

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