What are Case Database Actions?
A Case Database is an author-configurable data store in a BRYTER Application that allows authors to store (case) records. Authors can create Case Databases within an Application. They can configure the fields – the database schema – and use the configured database in READ or WRITE Database Nodes in their Modules. These native Case Databases can replace existing external database or Excel Integrations and enable case management use cases.
There are two types of actions in terms of Case Databases, one is geared toward feeding values into the Database (WRITE) while the other lets you retrieve stored values (READ). Learn more about both types of actions below:
Writing values into Case Database
In any Module within the same Application, you can read and write Case Database entries by creating an Action Node, then selecting the respective Case Database node from the list, just above the Integrations. Insert or add the Database Node at a position in your graph where all required values can be mapped into the respective fields.
Note that the Database Node default action is READ, if you want to write into the Database, select WRITE.
To create a new entry (i.e., to write a value into a Database) you can follow one of two routes that are dependent on your use of the Unique Identifier (ID):
You can choose to
- leave the ID field empty
- specify an ID
When you leave the ID field empty, one will be generated for you automatically. Alternatively, you can specify an ID yourself but would need to ensure that it is unique to this Database as existing entries with common IDs would be overwritten.
However, there may be times when you want to make use of this situation – specifically when you want to update an entry within your Database; more on this later.
You would typically position a Database Node that writes into a Database rather low in your Module, following all Value, Action, and Input Nodes as you will want to gather information from the aforementioned via @-referencing.
Note that in order to write into the Database, you will need to publish your Module. The previously empty DATA VIEWER of the Case Database will now display the stored values according to the publishing environment (TEST or LIVE) of the Module.
Reading values from a Case Database
Once you have created entries into your Case Databases, the stored values can be retrieved using a READ Database Node.
You can read values by specifying an ID through the use of @-referencing, e.g., from an Input Node, a URL Parameter, or a Value Node.
If the entry exists, you can read all fields in the Database and retrieve the values stored in it through @-referencing the fields in any Node that follows.
Whenever you want to read from a Database Node, you would typically position the Node rather high in your graph – after the Identifier has been entered or passed through via URL Parameter to retrieve the relevant case.
Updating existing values in a Case Database
A READ Database Node is often used in combination with a WRITE Database Node whenever values need to be updated.
When you specify an ID in a write Action AND an entry with that ID exists in the Database, the existing entry will be updated with the new values provided. Only fields with a non-blank value get overwritten. Existing entries that no new values were assigned to remain filled with their previous information. In other words, authors need to enter the ID and only map values onto Database INPUT fields that require updating or "overwriting".
💡 Best practices
- Label your Database Node to reflect whether a READ or WRITE Action is performed.
- Consider adding a Condition after reading out of a Database whenever the ID field has been left blank to account for faulty or non-existent IDs.
Keywords: data base; databse; Datenbank