Actions: Database

Append to Value

Appends data to the specified key’s value of a given table.

Argument Description
Target The place to access the records (local or cloud).
RecordID The ID of the specified record (Either a variable or a value).
Key The key whose value will be appended to.
Value The data appended to the selected key’s value.
TableName The table where the specified key is located.
Delimiter An optional space or command separating the appended value.
DelaySend Optional argument to delay the action if the target is ‘cloud’. Use ‘Flush the Cache’ to process delayed transactions.

Calc Update The Record

Performs one or more calculations on an existing record with the specified key(s), value(s), and operation and updates the record with the results.

Argument Description
DelaySend Optional argument to delay the action if the target is ‘cloud’. Use ‘Flush the Cache’ to process delayed transactions.
Data An array containing key-value pairs where the key belongs to the specified table and the value is the numeric value to be used in the calculation.
Operator The mathematical operator used in the calculation (add, subtract, multiply, divide).
Target The place to update the record (local or cloud).
TableName The table of the record to be updated.
RecordID The ID of the record to be updated.
Output The location where the results will go (variable).

Count Records

This function counts the number of records (either cloud or local) in a given table.

Argument Description
Output The location where the results will go (variable or element).
TableName The table where the specified records are located.
Target The place to access the records (local or cloud).

Create The Record

Creates a new record in the specified table with the provided data.

Argument Description
Output The location where the created record’s ID will be stored (variable).
TableName The table where the new record will be created.
Data An array containing key-value pairs.
Target The place to create the record (local or cloud).
DelaySend Optional argument to delay the action if the target is ‘cloud’. Use ‘Flush the Cache’ to process delayed transactions.

Delete Keys

Delete the specified keys from a record’s contents.

Argument Description
TableName The table where the specified records are located.
Keys A selection of keys (fields) used to make a record.
RecordIDs A line delimited list where each line is the cdbRecordID of a record in the specified table.
Target The place to access the records (local or cloud).

Delete the Record

Removes one or more records in a table.

Argument Description
TableName The table whose record(s) will be deleted.
RecordID The recordID(s) of the record(s) to delete in the specified table.
Target The place to access the records (local or cloud).
DelaySend Optional argument to delay the action if the target is ‘cloud’. Use ‘Flush the Cache’ to process delayed transactions.

Flush the Cache

Flushes the cache where cloud actions with a delaySend of ‘true’ are stored.

Get Table ID

Get and return the ID of the given table name.

Argument Description
TableName The name of the table whose ID you wish to know
Output The location where the results will go (variable or element).

Get Table Keys

Get and return the comma-separated list of the keys.

Argument Description
TableName The name of the table whose keys you wish to know
Output The location where the results will go (variable or element).

Get the Result

Get the result of the last CanelaDB call.

Argument Description
WhichResult Select the kind of result you need.

(Boolean) - if ‘completed’ or empty is passed.
(String) - if ‘context’, ‘response’, ‘date’, or ‘log’ is passed.
(Array) - if ‘recent’ is passed.
OutputVariable Which of the results do you want? See dictionary panel for more

List Records

Get a line delimited list of all the recordIDs for the specified table.

Argument Description
TableName The table where the specified records are located.
Target The place to access the records (local or cloud).
Keys A selection of keys (fields) used to make a record.
Output The location where the results will go (variable or element).

Look Up Value

Retrieves the value associated with the specified key for a given record.

Argument Description
Output The location where the results will go (variable or text or field element).
TableName The table where the specified record is located.
RecordID The ID of the specified record (Either a variable or a value).
Key The key whose value will be retrieved.
Target The place to access the records (local or cloud).

Ping

Pings the cloud server where the table is located and returns the response time in milliseconds. This action will be processed by the server, so a response indicates that the server is running and is processing requests.

Argument Description
Table The table name or table ID to ping. If a table is not specified, then a table will be chosen at random.
Output The location where the result will go (variable or text element).

Ping Node

Only compatible with desktop platforms. Calling this action on a mobile platform will return the value ‘N/A’. Pings the cloud server where the table is located and returns the response time in milliseconds. This function is NOT processed by the cloud server, so it only checks if the server is reachable from the client, not if the cloud server is actually running. Ping Node uses shell command ‘ping’. As such, the response will be shorter than the ‘ping’ action response.

Argument Description
Table The table name or table ID to ping. If a table is not specified, then a table will be chosen at random.
Output The location where the result will go (variable or text element).

Query Records

Searches the specified table and returns the records that match the provided query.

Argument Description
ResultFormat The format of the query’s result, either a line-delimited list (recordList) or an array containing the records’ data (recordData).
Key The key in the table to query on.
Operator The comparison operator for comparing values in the table against the input value.
Target The place to access the records (local or cloud).
TableName The table whose records will be queried.
Value The value to compare the records against.
Output The location where the results will go (variable).

Read Keys

Read a specific set of records and get only the specified keys for each returned record.

Argument Description
Output The location where the results will go (variable or element).
TableName The table where the specified records are located.
Keys A selection of keys (fields) used to make a record.
RecordIDs A line delimited list where each line is the cdbRecordID of a record in the specified table.
Target The place to access the records (local or cloud).

Read the Record

Reads one or more records in a table.

Argument Description
TableName The table whose record(s) will be read.
RecordIDs A line delimited list where each line is the cdbRecordID of a record in the specified table.
Target The place to access the records (local or cloud).
Output The location where the results will go (variable or element).

Sort Records

Sorts a list of record IDs based on the specified key, direction, and sort type.

Argument Description
Target The place to access the records (local or cloud).
Key The key to sort records by.
Direction Which direction (ascending or descending) to sort the records by.
RecordIDs A line delimited list where each line is the cdbRecordID of a record in the specified table.
TableName The table whose records will be sorted.
SortType The type of data stored in the key’s value to sort by.
Output The location where the results will go (variable or text or field element).

Sum the Column

Calculates the sum of all the values for the specified key of a given table.

Argument Description
TableName The table where the specified key is located.
Key The key whose values will be summed.
Target The place to access the records (local or cloud).
Output The location where the results will go (variable or text or field element).

Sync Records

Syncs a list of records in a specified table between local and cloud.

Argument Description
DetectCollisions Whether to compare record versions and avoid overwriting records if the source has a lower version (true) or to ignore record versions and have all source records overwrite target records (false).
Output The location where the collision or sync results will go (variable).
RecordIDs A line delimited list where each line is the cdbRecordID of a record in the specified table.
TableName The table whose records will be synced.
Source The direction of the sync (cloud or local).
AllowDeletes Whether to remove records in the target if they don’t exist in the source (true) or to ignore them (false).

Update The Record

Updates an existing record in the specified table with the provided data.

Argument Description
DelaySend Optional argument to delay the action if the target is ‘cloud’. Use ‘Flush the Cache’ to process delayed transactions.
TableName The table of the record to be updated.
Data An array containing key-value pairs.
RecordID The ID of the record to be updated.
Target The place to update the record (local or cloud).

This chapter was last updated on Wed 8 Feb 2023 14:24:05 GMT