ByteChef LogoByteChef

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

NameLabelTypeDescriptionRequired
tableTableSTRINGtrue
recordsnullDYNAMIC_PROPERTIES
Depends On table
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

NameLabelTypeDescriptionRequired
tableTableSTRINGtrue
deleteByDelete BySTRING
Options IDS, 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
idsRecord IDsARRAY
Items [INTEGER($id)]
IDs of records to delete; required unless Delete By is Conditions, and ignored when it is.true
conditionsOR ConditionsARRAY
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

NameTypeDescription
deletedCountINTEGER
deletedIdsARRAY
Items [INTEGER]

Output Example

{
  "deletedCount" : 1,
  "deletedIds" : [ 1 ]
}

Update Record

Name: updateRecord

Update values in an existing record

Properties

NameLabelTypeDescriptionRequired
tableTableSTRINGtrue
idRecord IDINTEGERtrue
valuesDYNAMIC_PROPERTIES
Depends On table
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

NameLabelTypeDescriptionRequired
tableTableSTRINGtrue
conditionsOR ConditionsARRAY
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
valuesDYNAMIC_PROPERTIES
Depends On table
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

NameLabelTypeDescriptionRequired
tableTableSTRINGtrue
idRecord IDINTEGERtrue
expandExpandARRAY
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

NameLabelTypeDescriptionRequired
tableTableSTRINGtrue
conditionsOR ConditionsARRAY
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
sortColumnSort ColumnSTRING
Depends On table
Column to sort the records by. Records are sorted by id when not set.false
sortDirectionSort DirectionSTRING
Options ASC, DESC
Order of the Sort Column: Ascending or Descending. Has no effect when Sort Column is not set.false
expandExpandARRAY
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
limitLimitINTEGERMaximum number of records to returnfalse
offsetOffsetINTEGERNumber of records to skipfalse

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

NameLabelTypeDescriptionRequired
tableTableSTRINGtrue

Example JSON Structure

{
  "label" : "Clear Table",
  "name" : "clearTable",
  "parameters" : {
    "table" : ""
  },
  "type" : "dataTable/v1/clearTable"
}

Output

Type: OBJECT

Properties

NameTypeDescription
deletedCountINTEGER

Output Example

{
  "deletedCount" : 1
}

Triggers

Record Created

Name: recordCreated

Triggers when a new record is inserted into the selected table.

Type: DYNAMIC_WEBHOOK

Properties

NameLabelTypeDescriptionRequired
tableTableSTRINGSelect 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

NameLabelTypeDescriptionRequired
tableTableSTRINGSelect 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

NameLabelTypeDescriptionRequired
tableTableSTRINGSelect 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

On this page