Log in to the Kuika platform and open the project you are working on.
Go to the UI Design module and open the Properties panel on the right panel.
From the + ADD ACTION menu, add the Managed DB > Save Record action according to the trigger event you want (Initial Actions, OnClick, OnBlur, etc.).
Save Record Action Modes
There are three different modes for the Save Record action:
Smart Mode:
If the Id sent with the action matches an Id in the table, the UPDATE operation is executed; otherwise, the INSERT operation is executed.
Example: If there is an Id belonging to the user record in the database, the data is updated. Otherwise, a new user record is added.
Insert Mode:
If there is no record matching the given Id in the table, a new record is created. However, if there is a record matching the given Id, an error is returned.
Example: If there is a record with the same Id in the system, the new record is not added and an error message is displayed.
Update Mode:
If there is a record that matches the Id given in the table, the record is updated. If there is no matching record, no action is taken.
Example: The record in the database is updated with the specified Id. If there is no record with the Id, no action is taken.
Table Selection and Conditions in the Save Record Action
Table Selection:
“Select Table” field, select the table to be used for the record operation.
“Select Table” field, select the table to be used for the record operation. When the table is selected, a Multi Select field titled “Select Columns” is displayed. This field lists the columns belonging to the selected table. The columns are defined as action parameters and determine the functionality of the action.
Adding Conditions:
If the “Update” mode is selected for the action, a field representing the table entries to be updated appears below the action.
Conditions can be linked together using the AND structure. Alternatively, an OR condition group can be created so that the action is executed when any condition is met.
Example: If the username and email conditions are met, the record in the database is updated.