Data Table
Work with ByteChef Data Tables and react to row changes.
Categories: Helpers
Type: dataTable/v1
Actions
Create Record(s)
Name: createRecords
Insert one or more new records to a table. The records are inserted together: a record that is not valid stops the step and no record is inserted.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| table | Table | STRING | true | |
| records | null | DYNAMIC_PROPERTIES Depends Ontable | The records to insert, as an object with a values array holding one object per record that maps column names to values: {"values": [{"<column>": <value>}, ...]}. A plain array or a flat object of column values is not accepted. | true |
Example JSON Structure
{
"label" : "Create Record(s)",
"name" : "createRecords",
"parameters" : {
"table" : "",
"records" : { }
},
"type" : "dataTable/v1/createRecords"
}Output
The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.
Delete Record(s)
Name: deleteRecords
Delete records from a table by ID or by conditions
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| table | Table | STRING | true | |
| deleteBy | Delete By | STRING OptionsIDS, CONDITIONS | Whether to delete the records with the given IDs or every record that matches the conditions. The editor asks for Record IDs until Conditions is chosen. In a workflow definition that leaves it out, conditions are used if only OR Conditions is given and Record IDs otherwise; it must be set when both are given. | false |
| ids | Record IDs | ARRAY Items[INTEGER($id)] | IDs of records to delete; required unless Delete By is Conditions, and ignored when it is. | true |
| conditions | OR Conditions | ARRAY Items[[{STRING(column), STRING(operation), STRING(value), STRING(valueTo), [STRING](values)}]] | OR Condition array that contains AND Condition arrays; required when Delete By is Conditions. Every record that meets every condition of at least one AND Condition is deleted. Use Clear Table to delete every record. | true |
Example JSON Structure
{
"label" : "Delete Record(s)",
"name" : "deleteRecords",
"parameters" : {
"table" : "",
"deleteBy" : "",
"ids" : [ 1 ],
"conditions" : [ [ {
"column" : "",
"operation" : "",
"value" : "",
"valueTo" : "",
"values" : [ "" ]
} ] ]
},
"type" : "dataTable/v1/deleteRecords"
}Output
Type: OBJECT
Properties
| Name | Type | Description |
|---|---|---|
| deletedCount | INTEGER | |
| deletedIds | ARRAY Items[INTEGER] |
Output Example
{
"deletedCount" : 1,
"deletedIds" : [ 1 ]
}Update Record
Name: updateRecord
Update values in an existing record
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| table | Table | STRING | true | |
| id | Record ID | INTEGER | true | |
| values | DYNAMIC_PROPERTIES Depends Ontable | true |
Example JSON Structure
{
"label" : "Update Record",
"name" : "updateRecord",
"parameters" : {
"table" : "",
"id" : 1,
"values" : { }
},
"type" : "dataTable/v1/updateRecord"
}Output
The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.
Update Records
Name: updateRecords
Update values in every record that matches conditions
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| table | Table | STRING | true | |
| conditions | OR Conditions | ARRAY Items[[{STRING(column), STRING(operation), STRING(value), STRING(valueTo), [STRING](values)}]] | OR Condition array that contains AND Condition arrays. Every record that meets every condition of at least one AND Condition is updated. | true |
| values | DYNAMIC_PROPERTIES Depends Ontable | true |
Example JSON Structure
{
"label" : "Update Records",
"name" : "updateRecords",
"parameters" : {
"table" : "",
"conditions" : [ [ {
"column" : "",
"operation" : "",
"value" : "",
"valueTo" : "",
"values" : [ "" ]
} ] ],
"values" : { }
},
"type" : "dataTable/v1/updateRecords"
}Output
The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.
Get Record
Name: getRecord
Get single record by its id
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| table | Table | STRING | true | |
| id | Record ID | INTEGER | true | |
| expand | Expand | ARRAY Items[STRING] | Link columns to replace with the linked record. An expanded link holds the id, externalId and values of the record it points to, or null when empty. | false |
Example JSON Structure
{
"label" : "Get Record",
"name" : "getRecord",
"parameters" : {
"table" : "",
"id" : 1,
"expand" : [ "" ]
},
"type" : "dataTable/v1/getRecord"
}Output
The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.
Find Records
Name: findRecords
Find records in a table that match conditions
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| table | Table | STRING | true | |
| conditions | OR Conditions | ARRAY Items[[{STRING(column), STRING(operation), STRING(value), STRING(valueTo), [STRING](values)}]] | OR Condition array that contains AND Condition arrays. A record is returned when it meets every condition of at least one AND Condition. Leave empty to return every record, up to Limit. | false |
| sortColumn | Sort Column | STRING Depends Ontable | Column to sort the records by. Records are sorted by id when not set. | false |
| sortDirection | Sort Direction | STRING OptionsASC, DESC | Order of the Sort Column: Ascending or Descending. Has no effect when Sort Column is not set. | false |
| expand | Expand | ARRAY Items[STRING] | Link columns to replace with the linked record. An expanded link holds the id, externalId and values of the record it points to, or null when empty. | false |
| limit | Limit | INTEGER | Maximum number of records to return | false |
| offset | Offset | INTEGER | Number of records to skip | false |
Example JSON Structure
{
"label" : "Find Records",
"name" : "findRecords",
"parameters" : {
"table" : "",
"conditions" : [ [ {
"column" : "",
"operation" : "",
"value" : "",
"valueTo" : "",
"values" : [ "" ]
} ] ],
"sortColumn" : "",
"sortDirection" : "",
"expand" : [ "" ],
"limit" : 1,
"offset" : 1
},
"type" : "dataTable/v1/findRecords"
}Output
The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.
Clear Table
Name: clearTable
Delete all records from a table
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| table | Table | STRING | true |
Example JSON Structure
{
"label" : "Clear Table",
"name" : "clearTable",
"parameters" : {
"table" : ""
},
"type" : "dataTable/v1/clearTable"
}Output
Type: OBJECT
Properties
| Name | Type | Description |
|---|---|---|
| deletedCount | INTEGER |
Output Example
{
"deletedCount" : 1
}Triggers
Record Created
Name: recordCreated
Triggers when a new record is inserted into the selected table.
Type: DYNAMIC_WEBHOOK
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| table | Table | STRING | Select a Data Table. | true |
Output
The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.
JSON Example
{
"label" : "Record Created",
"name" : "recordCreated",
"parameters" : {
"table" : ""
},
"type" : "dataTable/v1/recordCreated"
}Record Updated
Name: recordUpdated
Triggers when a record is updated in the selected table.
Type: DYNAMIC_WEBHOOK
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| table | Table | STRING | Select a Data Table. | true |
Output
The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.
JSON Example
{
"label" : "Record Updated",
"name" : "recordUpdated",
"parameters" : {
"table" : ""
},
"type" : "dataTable/v1/recordUpdated"
}Record Deleted
Name: recordDeleted
Triggers when a record is deleted from the selected table.
Type: DYNAMIC_WEBHOOK
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| table | Table | STRING | Select a Data Table. | true |
Output
The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.
JSON Example
{
"label" : "Record Deleted",
"name" : "recordDeleted",
"parameters" : {
"table" : ""
},
"type" : "dataTable/v1/recordDeleted"
}How is this guide?
Last updated on