Database Action
The Database Action creates, updates and deletes records from a local or external database table. Use it to store data or log submissions.
Create Record
Creates or updates a database table record.
Setting | Description | Required | Dynamic |
---|---|---|---|
Database | The name of the database to which to connect. | ✓ | |
Custom Connection | Allows overriding the system default database connection. | ||
-- Host | The server host IP or address to which to connect, e.g. 127.0.0.1 . | ✓ | |
-- Port | The port to use for the connection, e.g. 3306 . | ✓ | |
-- Creds | The username & password which to use for the connection. | ✓ | |
Table | The name of the database Table to which to connect. | ✓ | |
Update Record | Should a record be updated instead of created. | ||
-- Associative Key | The table column key that will be used to associate the record. | ✓ | |
-- Associative Value | The table column value that will be used to associate the record. | ✓ | ✓ |
Content | The mapping configuration of the submission data to the table columns. | ✓ | ✓ |
Advanced | |||
Action Name | The name to reference this action. | ||
Status | Defines if the action is enabled or disabled . | ||
Execution | A composed condition that must be met in order for the action to be executed. | ✓ |
Once the basic configuration has been set, the resource fields will load for mapping. The mapping will determine the value that each resource field will be created or updated with. Each field can be mapped to a static or dynamic value.
Most mapping is optional
In fact, mapping is disabled by default and must be enabled for each field by clicking on the last toggle icon.
When the Update Record setting is enabled the submitted data will override an existing table record determined by the association configuration. If no associated record is found, a new record will be created instead.
An example to understand the association is to think of a Users Table with an ID column as its primary key. In such a scenario, the submission data should contain the user_id value representing the user row being updated, the Associative Key should be set as ID, and the Associative Value mapped to the Form Submission user_id.
Delete Record
Deletes a database table record.
Setting | Description | Required | Dynamic |
---|---|---|---|
Database | The name of the database to which to connect. | ✓ | |
Custom Connection | Allows overriding the system default database connection. | ||
-- Host | The server host IP or address to which to connect, e.g. 127.0.0.1 . | ✓ | |
-- Port | The port to use for the connection, e.g. 3306 . | ✓ | |
-- Creds | The username & password which to use for the connection. | ✓ | |
Table | The name of the database Table to which to connect. | ✓ | |
Advanced | |||
Action Name | The name to reference this action. | ||
Status | Defines if the action is enabled or disabled . | ||
Execution | A composed condition that must be met in order for the action to be executed. | ✓ |