Lookup by Value or Create

Lookup a row in a database by a value in a column or create it if it does not exist.

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

What does it do?

The Lookup by Value or Create block allows you to search a database for a row with a specified column that matches a value, or if no row is found create one.

Example of Lookup by Value or Create Block


Inputs

Database

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

The database must exist on the current bot.

Example: my_database

Column

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!

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

Value 2

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

Example: Example value!

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

Value 3

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

Example: Example value!

Column 4

Provide the name of a column in the selected database.

Make sure that the column exists in the selected database.

Example: my_column

Value 4

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

Example: Example value!

Column 5

Provide the name of a column in the selected database.

Make sure that the column exists in the selected database.

Example: my_column

Value 5

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

Example: Example value!

Outputs

Row Created

A boolean that is either true or false depending on if a row was created.

Example: true

Row ID

The Row ID of either the retrieved row or the created row.

Example: abcdef12-3456-7890-abcd-ef1234567890

Created At (Unix)

The Unix timestamp of when the row was created.

Example: 1731886315

Updated At (Unix)

The Unix timestamp of the last time the row was updated.

Example: 1731886315