Skip to main content

Using Tables in Automations

Overview

Tables can be manipulated using workflow actions. The Table related actions are listed under the Tables collection in the actions explorer.

Query a Table (Select Records)

Querying a table for records can be performed using the Select Action on the tables' collection. The Select action allows you to specify a query parameter which follows RQL query pattern, in the following format:

{
"select": [] // list of fields to select
"limit": 100 // limit the amount of records that will return (max is 1000)
"offset": 0 // the offset from where to return the data
"filter": {
key: value // this option lets you filter a specific key with its value
// for example "name": "Public"
key: {
"$gt", "$gte", "$lt", "$lte",
"$contains_any", "$contains_all", "$like": value
// this options lets you do more advanced filtering, for example checking
// if a record was created in the past 25 minutes.
// "$gt": {{ to_epoch(now() - '25m') * 1000 }}
}
}
}
  • Select - Specify which fields to return by specifying fields name using the Select option.
  • Filter - specify which records to return using the Filter option - only records that is the Is Admin value is false.
  • Sort - Define the sorting criteria by designating the relevant field and order. For ascending order, use '+' before the field name; for descending order, use '-' instead.
ParameterDescription
Table NameThe name of the table.
Query-

Select Records

Query a Table Using SQL

Querying a table for records can also be performed by using the SQL Query action.

ParameterDescription
SQL QueryThe SQL query to run.
Output FormatThe desired output format.

approvals

info

To fetch the correct scheme of record creation, select existing records using the Select action and use the scheme provided in the output.

Add a Record

Add a record to a table. Two ways:

Entering the Values Manually

Add a record to a table by manually entering the table field name and the table field value.

Parameters:

ParameterDescription
Table NameThe name of the table.
RecordData of record, manually enter the field name and field value.

Add a record

JSON Format

Records can be added by inputting values in JSON format. Bulk creation is also supported, allowing the input of a list of JSON objects.

Parameters:

ParameterDescription
Table NameThe name of the table.
RecordData of record, a JSON format containing key : value pairs. Can also be a list of JSON objects.

Add a record

Get a Record

Get record(s) from a table. Two ways:

RQL Format

Get a Record by entering values using RQL format.

Parameters:

ParameterDescription
Table NameThe name of the table.
RQLThe RQL query to run.

Update Record

Table Fields

Get a Record from a table by entering the specified table fields.

Parameters:

ParameterDescription
Table NameThe name of the table.
FieldsTable Fields.
Condition (optional)Condition that compares two table field values.

Update Record

Update a Record

Update a record on a table.

ParameterDescription
Table NameThe name of the table.
Record IDThe record unique identifier. Can be obtained via the Select action.
RecordData of record, a JSON format containing key : value pairs.

In the below example, the Admin field is updated:

Update Record

Delete a Record

Delete a record from a table. Two ways:

By Record ID

  1. Delete a record from a table by the record ID.

Parameters:

ParameterDescription
Table NameThe name of the table.
Record IDThe record unique identifier. Can be obtained via the Select action.

Delete Record

Conditional Statements

  1. Delete a record from a table only when a certain condition is met.

Parameters:

ParameterDescription
Table NameThe name of the table.
Condition (Optional)Condition that compares two table field values.

Delete Record

Create a Table

Create a table based on a schema.

Parameters:

ParameterDescription
Table NameThe name of the table.
Table SchemaThe schema of the table in JSON format.
For more information, see the Copy table schema.
SkipSkips table creation if table with the same name already exists.

Create Table

Does Table Exist

Check if a table with a given display name exists.

When using the Create Table action, and the inserted name of a Table already exists, the Create Table action will fail. In order to prevent this scenario, you are recommended to use the Does Table Exist Action before the Create Table step.

Parameters:

ParameterDescription
Table NameThe name of the table.
Search BySearch by name, display name or both. Default is display name.

Does Table Exist

Clear a Table

Clear all table records.

Parameters:

ParameterDescription
Table NameThe name of the table.

Clear Table

Delete a Table

Deletes table.

Parameters:

ParameterDescription
Table NameThe name of the table.

Delete Table

Copy table schema

For each table that was created, there is a table schema.

Table overview

Click the 3 dots menu of the table > Copy table scheme.

Copy table schema

Example schema

{
"fields": [
{
"display_name": "Date",
"description": "",
"type": "date",
"attributes": {
"hidden": false,
"include_time": false,
"options": [],
"required": false,
"width": 165
}
},
{
"display_name": "Action",
"description": "",
"type": "text",
"attributes": {
"hidden": false,
"options": [],
"required": false,
"width": 165
}
},
{
"display_name": "User",
"description": "",
"type": "user",
"attributes": {
"hidden": false,
"options": [],
"required": false,
"width": 165
}
}
]
}

On New Record - Event-Based Trigger

The New Table Record option is an event-based trigger that executes your automation every time a new record is added to your table.

New Record Trigger

note

Please note that the "Table Name" in the trigger setup must exactly match the name you assigned to your table.

New Record Trigger