Skip to main content

Actions (DB Entity)

By default, CRUD actions are automatically generated for all DB entities and exposed as APIs. Developers have the flexibility to enable or disable specific entity actions based on application requirements.

Additionally, entity actions can be configured as internal methods by deselecting the "Expose as API" option. Internal actions that are not exposed as APIs can still be invoked within other Server Flows, allowing controlled access to entity operations.

Example API Calls for Employee Entity​

Action MethodDescriptionHTTP MethodEndpoint Example
CreateAdds a new Employee recordPOST/api/v1/employees
Read (Get By ID)Retrieves an Employee by IDGET/api/v1/employees/{Id}
Read (Get All)Fetches all Employees (with pagination)GET/api/v1/employees?offset=0&pageSize=10
UpdateUpdates an existing EmployeePUT/api/v1/employees
DeleteDeletes an Employee by IDDELETE/api/v1/employees/{Id}
Create or UpdateCreates or updates an EmployeePOST/api/v1/employees/save
Bulk CreateAdds multiple Employees at oncePOST/api/v1/employees/bulk
Bulk UpdateUpdates multiple Employee records at oncePUT/api/v1/employees/bulk
Bulk Create or UpdateCreates or updates multiple Employee recordsPOST/api/v1/employees/bulk/save

Action Properties & Configuration Steps​

Action Properties​

S.NoPropertyDescription
1NameName of the action to be generated.
2Expose as APIDetermines whether the action should be exposed as an API. If unchecked, it remains internal.
3PaginationFetches records in multiple pages if enabled. Visible only for actions returning array-type data.

Steps to Configure and Expose Actions as APIs:​

  1. Right-click the "Actions" folder in an entity from the Explorer menu and select "Select Actions."
  2. The Properties Panel will appear.
  3. Select the required actions to expose them as APIs. To expose all, click "Select All."
  4. Enable the "IsPaginated" checkbox for GET APIs to fetch results in multiple pages.
  5. Uncheck "Expose As API" if the action should remain internal but still callable in a server flow.
  6. Click Save to apply the changes.
  7. Upon successful configuration, the system displays: "Actions saved successfully."

Upon successful configuration, the message "Actions changes applied successfully" appears.

Note: To configure additional actions, right-click created "DB Entity" and select "Select Actions."

Implementing Custom Actions​

In addition to the default action methods, users can define custom actions using Server Flows to handle complex operations.

Steps to Implement Custom Actions​

  1. Create Queries or Stored Procedures — Define queries or stored procedures to perform complex database operations efficiently.
  2. Create a Server Flow — Design a Server Flow to encapsulate the logic for executing database operations. Use the Run Query construct to execute the queries or stored procedures and fetch the required data.

Actions

Actions