Learn about databases in Actioner and how to configure them.
Databases in Actioner
A database is an organized collection of information, or data that is set up for easy access, management and updating the information. Databases are used for various data processing operations, the most basic being the Create, Read, Update, and Delete (CRUD) operations.
Databases in Actioner are scoped to the app they are added to, meaning that they can be accessed, managed or updated inside the app they belong to. Actions in an app can use databases to store, get, update or delete the necessary data. For example, when a time-off request is submitted in a HR app that works in Slack, you can store the data of the request in a database for future use.
You can use databases to:
- Store and retrieve different types of data.
- Perform aggregation, sorting, filtering, and other preprocessing operations for data analytics.
- Safely store and persist information for future use.
- Define the correlation between all the stored data.
Data within a database is modeled in rows and columns in a series of tables to make processing and data querying efficient. A database typically stores information in different tables containing specific pieces and types of data. For example, an e-commerce app could store details of their customers’ in one table and details of their orders in another.
The data stored in a table can then be easily accessed, managed, modified, updated, controlled, and organized. Actioner databases use a structured language for querying data.
An app can contain multiple data tables. A table defines the structure and validation rules of the data it holds.
A data table is composed of fields and records.
You can think of fields as the columns in relational databases or the document properties in a non-relational database where a table correspond to a document. Similarly, records are the correspondant of rows in a relational database, or the values of the document properties in a non-relational database.
Tables are the templates or definitions for holding records. When a record in a table is created, meaning that fields have values assigned, these entities are called records. Records are instances of a table with specific field values. Each record is also a JSON document, namely key-value pairs.
When new data is added, new records are inserted into existing tables. Relationships can then be made between two or more tables by defining dependencies between them. For an e-commerce app, you can design a table for your orders consisting of customer, product and purchase details field. You can design another table for your customers containing fields such as email, shipping, and billing addresses. Similarly, you can have a table for your product details. Instead of storing all the info in one table and having to update multiple fields when your customer updates their shipping address, you can connect the customer field in your orders table with customers table, or the product field in your orders table with product table.
To see the databases in your app or create new ones, navigate to your app on My apps page and go to Databases tab.
App users (users with the right to run the actions of that app) can view the databases. Only app admins can create new databases or update the existing ones.
Creating a new data table
On Databases tab of your app, click + Add new table.
Give a name to your table. You can optionally add a description.
By default, each table is created with an
idis automatically generated to identify a record in a model and it cannot be edited or deleted.
To add new fields to your table, click + Add new field.
Available field types are text, email, URL, phone number, UUID, integer, decimal, date time, list, map, boolean and reference.
- Enter a name for your field and configure its properties.
Select if the field will be required. While creating a new record in your table, required fields must be provided.
Select if the field will be read-only.
Set a default value that your field will take if the field value is not provided as input.
Set constraint length by entering a min and a max value for your field.
Set regular expression if you are looking to strengthen filtering of data and extracting information to your table records.
You can add more fields by clicking + Add new field button. And you can navigate between your field by clicking on their name.
Once all is set, save your data table.
To add new records to your table, click Data record button on Databases tab of your app.