What are row factors?
Add Table
. You can then give your table a name and add fields to it. Each field has a name and a type. The type determines the kind of data that can be stored in the field. For example, a field with the type String
can store any text value, while a field with the type Number
can only store numeric values.
Searchable
checkbox. This will allow you to search for records based on the values in the field. For example, if you have a field called Name
and you make it searchable, you can search for records based on the name of the person. This is available for fields of type String
, Object
, Array
and custom schemas.
String
, Number
, Boolean
, Date
, Object
, Array
and custom schemas.
createdAt
AND status
will only show records that match both conditions.
createdAt
OR updatedAt
will show records that match either one of the conditions.
is equal to
: Shows records where the field is equal to the specified value.is not equal to
: Shows records where the field is not equal to the specified value.less than
: Shows records where the field is less than the specified value.less than or equal to
: Shows records where the field is less than or equal to the specified value.greater than
: Shows records where the field is greater than the specified value.greater than or equal to
: Shows records where the field is greater than or equal to the specified value.in
: Shows records where the field matches any of the specified values.not in
: Shows records where the field does not match any of the specified values.is null
: Shows records where the field is empty.is not null
: Shows records where the field is not empty.Filter
button to expand the filter menu.createdAt
).is equal to
).+ Rule
button.+ Group
button.Apply filter
button.Add Record
button to add a new record. You can then enter the values for each field in the record.
Enter
to see an input that allows you to change the cell value. Once you are done, press Enter
again or click away to save the new value.
Right Click
on the Record and select Delete Record
to delete a record from a table.
listTables
function. This function will return an array of all the tables in the bot.
findTableRows
function. You can specify the limit (number of records to return) and the offset (number of rows to start from).
Column | Type | Key | Count | Sum | Avg | Max | Min | Unique |
---|---|---|---|---|---|---|---|---|
id | number | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
createdAt | date | ✔️ | ✔️ | ✔️ | ✔️ | |||
updatedAt | date | ✔️ | ✔️ | ✔️ | ✔️ | |||
name | string | ✔️ | ✔️ | ✔️ | ✔️ |
keyColumn
.
keyColumn: The column used to identify the row. This column must be unique. Failure occurs if more than one row is found for the same key.
getTable
function. This will return the table definition, along with the total number of rows, number of stale rows and number of indexing rows.
deleteTable
function. This will permanently remove the table and all its records.
createRecord
function. You can specify the values for each field in the record. This function can be particularly useful when you need to store new information, such as a new user’s details or a newly completed transaction.
createRecords
function. You can specify the values for each field in the record. Useful for creating multiple records at once.
deleteRecord
function. You need to specify the record ID of the record you want to delete.
deleteRecords
function. You need to specify the record IDs of the records you want to delete in an array.
findRecords
function. You can add filters, just query everything or search using semantic search (like a Google Search!).
findRecords
function. This function allows you to specify the limit (number of records to return) and the offset (number of rows to start from).
For instance, if you want the first 10 records, you can set the limit to 10 and the offset to 0. To fetch the next 10 records, you can set the limit to 10 and the offset to 10.
To determine if there are more records available, you can check the length of the array returned. If the length is greater than 0, it indicates the presence of additional records.
Here’s an example:
$eq
: Matches values that are equal to a specified value.
$gt
: Matches values that are greater than a specified value.
$gte
: Matches values that are greater than or equal to a specified value.
$lt
: Matches values that are less than a specified value.
$lte
: Matches values that are less than or equal to a specified value.
$ne
: Matches all values that are not equal to a specified value.
$in
: Matches any of the values specified in an array.
$nin
: Matches none of the values specified in an array.
$exists
: Matches documents that have the specified field.
$mod
: Performs modulo operation on the value of field and matches documents where field % divisor equals the specified remainder.
$size
: Matches any document where an array field contains a specified number of elements.
$regex
: Provides regular expression capabilities for pattern matching strings in queries. It uses a placeholder to prevent SQL injections.
$options
: Modifies the $regex
operator to enable options. Currently, there are two options, ‘i’ for case insensitive and ‘c’ for case sensitive.
$and
: Joins query clauses with a logical AND. Returns all documents that match the conditions of both clauses.
$or
: Joins query clauses with a logical OR. Returns all documents that match the conditions of either clause.
$not
: Inverts the effect of a query expression and returns documents that do not match the query expression.
People with age greater than 18
adults
Search
in Botpress is employed to identify specific strings like a user’s name. It gives precision-based results by matching specific sets of characters.
On the other hand, an AI Filter
broadens the scope and is used primarily for filtering results rather than explicitly searching them. It helps you track down users based on certain criteria, such as age above 25.
Although the AI Filter is not primarily designed for exact string hunting, it’s flexible enough to allow it. For instance, you could use it to filter results for Canada
as a country.
getRecord
function to retrieve a specific record from a table based on a unique identifier. For example, you might use the getRecord
function to retrieve a user’s profile information based on their unique user ID.
updateRecord
function to modify a specific record in a table. This will be useful when you need to update a specific field in the record. For example, you might use this function to update a user’s profile information or to update the status of a transaction.
upsertRecords
function allows you to update or create records in a table in a single operation. It is useful for any situation where you need to update or insert data into a table without having to worry about whether the rows already exist.
Example:
Import Table
button above the table and select the CSV file you want to import. Botpress will automatically detect the column names and types from the CSV file and create the table structure for you.
Export Table
button to export the table. This will download the table as a CSV file to your computer.