When developing apps on the Kuika platform, you can create custom actions using SQL queries to enhance your app’s functionality. These actions allow you to customize your app’s behavior and provide users with a dynamic experience. In this tutorial, you’ll learn step-by-step how to create Custom Actions, integrate them into screens, and apply them to elements.
In Kuika, you can create custom actions and integrate them into your screens. In the Datasources module, you can view and manage existing data sources, actions, and tables.
Steps:

Purpose: To create an action in the application that lists the departments included in the employee list.
SELECT * FROM Department
WHERE DepartmentName LIKE @searchFor OR @searchFor IS NULL OR @searchFor = ''
ORDER BY DepartmentName;
The created action is listed under the Actions heading in the left panel. You can open, view, edit, or delete the action from here.
You can view on which pages and elements an SQL Action is used. This allows you to see, before making any changes, which parts of the application will be affected by changes made to the action.
In the action’s right-click menu, under the Edit SQL Action option, you’ll find the Copy query with parameters option. This option copies the query inside the action to the clipboard—with the parameter values entered on the screen already substituted—without requiring you to open the action. The copied query can be pasted directly into an SQL IDE and executed.
The notification that appears after the copy operation shows how many parameters were automatically filled in (e.g., 3 of 8 parameter values filled in.). This allows you to immediately see how many fields need to be filled in manually.
You can create custom actions in Kuikada via UI Design or Datasources modules.
Steps:
Kuika allows you to quickly add basic SQL queries:

Example Command: “Create a query that lists only active departments.”

Kuika SQL Editor supports the following developer tools to streamline the query writing process and improve code quality:
You can declare variables using the DECLARE statement in the Kuika SQL Editor.
DECLARE @variable_name data_type;Here:
1. Defining a Variable and Assigning Data
DECLARE @top1Product nvarchar(256);SELECT TOP 1 @top1Product = productName FROM table_name;2. Calculating the Number of Rows
DECLARE @rowCount int;SET @rowCount = (SELECT COUNT(Id) FROM table_name);Example command: “Create a DECLARE command that lists only active departments.”
The following system parameters can be used when creating an SQL Action in Kuika:
You can use these parameters to implement pagination, user-based data filtering, and dynamic SQL queries. Especially when working with large datasets, you can optimize your queries by dividing the data into pages using the @currentpage and @pagesize parameters.