Using Tables in Workflows
Table Actions
Tables can be manipulated using workflow actions. The Table related actions are listed under the Tables collection in the actions explorer.
Add a Record
There are two ways to Add a Record to a table
- Entering the Values Manually
- JSON Format
Add a record to a table by manually entering the table field name and the table field value.
Parameter | Description |
---|---|
Table | The name of the table. |
Record | Data of record, manually enter the field name and field value. |
Records can be added by inputting values in JSON format. Bulk creation is also supported, allowing the input of a list of JSON objects.
Parameter | Description |
---|---|
Table | The name of the table. |
Record | Data of record, a JSON format containing Key : Value pairs. Can also be a list of JSON objects. |
Create or Update Record
There are two ways to Create or Update a Record in a table.
- Entire Record
- JSON Format
Create or Update an entire Record in a table by selecting the entire record option.
Parameter | Description |
---|---|
Table | The name of the table. |
Create or Update Condition | Set the condition for deciding weather to create or update the selected record. |
Record Data Format | Entire Record |
Record | The value of the record you want to create or update |
Please note that if you leave any fields empty in the Create or Update Record action, the existing values in the table will remain unchanged.
In the below example, the Number
record field is updated.
Create or Update a Record in a table by entering values in JSON format.
Parameter | Description |
---|---|
Table | The name of the table. |
Create or Update Condition | Set the condition for deciding weather to create or update the selected record. |
Record Data Format | JSON |
Record | The value of the record you want to create or update in JSON format |
In the below example, the Admin
record field is updated.
Get a Record
There are three different ways to Get record(s)
from a table
- By Condition
- RQL Format
- SQL Query
Get a Record from a table by using a condition
. All records that match the condition will be returned.
Parameter | Description |
---|---|
Query Method | The query method to get records |
Table | The table you want to get records from. |
Fields | Table Fields. |
Condition | Condition that compares two table field values. |
Output Format | The format of the output the records are returned- Table, JSON or CSV . |
Limit (optional) | Limit the amount of records returned by the query. |
Offset (optional) | Choose the offset from the data to start querying the table from. |
Order By (optional) | Choose what field to order the results by. |
Sort (optional) | Sort the records by ascending or descending order. |
Include Query Metadata In Output (optional) | Check the box to include Query Metadata in the Output. |
All Pages (optional) | Check the box to return all data in the table(this setting invalidates the Limit and Offset fields.) |
Get Record(s)
by querying a table for records using the RQL
query method.
Parameter | Description |
---|---|
Query Method | The query method to get records |
Table | The table you want to get records from. |
RQL Query | The RQL query to run against the table. |
Condition | Condition that compares two table field values. |
Output Format | The format of the output the records are returned- Table, JSON or CSV . |
Limit (optional) | Limit the amount of records returned by the query. |
Offset (optional) | Choose the offset from the data to start querying the table from. |
Include Query Metadata In Output (optional) | Check the box to include Query Metadata in the Output. |
All Pages (optional) | Check the box to return all data in the table(this setting invalidates the Limit and Offset fields.) |
Get a Record by using RQL format lets you query a table for record(s) using the
Select
,Filter
orSort
actions on the tables' collection.- 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. For Example:"sort": [+"updated_at"]
RQL Format Example:
{
"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.
"sort": [+"updated_at"] // In this example we are sorting the "updated_at" value in ascending order as there is a + before the field value.
"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 }}
}
}
}
Get Record(s)
by querying a table for records using the SQL
query method.
Parameter | Description |
---|---|
Query Method | The query method to get records |
Table | The table you want to get records from. |
SQL Query | The SQL query to run against the table. |
Condition | Condition that compares two table field values. |
Output Format | The format of the output the records are returned- Table, JSON or CSV . |
Limit (optional) | Limit the amount of records returned by the query. |
Offset (optional) | Choose the offset from the data to start querying the table from. |
Include Query Metadata In Output (optional) | Check the box to include Query Metadata in the Output. |
All Pages (optional) | Check the box to return all data in the table(this setting invalidates the Limit and Offset fields.) |
SQL Format Example:
select
table_1.number as t1_num,
table_2.number as t2_num
from
table_1
left outer join
table_2
on
table_1.name = table_2.name
Delete a Record
There are two ways to Delete a Record
from a table:
- Record ID
- Conditional Statements
Delete a record from a table by the Record ID
.
Parameter | Description |
---|---|
Table Name | The name of the table. |
Record ID | The record unique identifier. Can be obtained via the Select action. |
Delete a record from a table only when a certain condition
is met.
Parameter | Description |
---|---|
Table Name | The name of the table. |
Condition (Optional) | Condition that compares two table field values. |
Create a Table
Create a table based on a schema.
Parameters:
Parameter | Description |
---|---|
Table Name | The name of the table. |
Table Schema | The schema of the table in JSON format.For more information, see the Copy table schema. |
Skip | Skips table creation if table with the same name already exists. |
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:
Parameter | Description |
---|---|
Table Name | The name of the table. |
Search By | Search by name , display name or both. Default is display name . |
Clear a Table
Clear all table records.
Parameters:
Parameter | Description |
---|---|
Table Name | The name of the table. |
Delete a Table
Deletes the entire table.
Parameters:
Parameter | Description |
---|---|
Table Name | The name of the table. |
Copy Table Schema
For each table that was created, there is a table schema.
- Click the 3 dots menu of the table > Copy table scheme.
Example of a Table 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 Workflow every time a new record is added to your table.
Please note that the "Table Name" in the trigger setup must exactly match the name you assigned to your table.