Create Custom Actions with SQL Editor in Datasources Module
In an application you develop with Kuika, you can create custom actions and use these actions on your screens. From the left menu of the Datasources module, you can view the data sources, actions and tables in the application you have developed, and add new data sources, actions and tables.
After logging in to the Kuika platform, open the project you will work on from the “Apps” screen.
In the “Datasources” (1) module, click on the “+” icon next to the “Actions” title on the left side.
Select “New SQL Action” from the menu that opens.
If you want to create a new Custom Action in the Actions sub-panel, click on New SQL Action. If you want to create a new folder and create Custom Actions under this folder, click on New Folder and name and create your folder.
In an example scenario, let's say you want to create an action that lists the departments in the personnel list. Before creating this action, you need to create a table named “Department”. You can find detailed information about table creation in our content.
Create a custom action named “Select Department List” to list the departments in your application.
Write the SQL query required for the listing in SQL Editor. The query is created automatically for tables on the add query screen.
To add a table-specific automatic query, click on the three dots next to the table name in the left menu. Kuika allows you to automatically add and modify “Select”, “Update” and “Delete” queries.
You can use the following query to list the departments with the Select Department List special action:
Copyselect *from Department WHERE DepartmentName LIKE@searchForOR@searchForisnullOR@searchFor=''ORDERBY DepartmentName
After writing the query, test your query with the “TEST” button in the upper right corner and then create the custom action by clicking the “CREATE” button.
You can view the action you created in the left panel, then edit, rename and delete it.
To edit the action, hover over the action and click on the three dots that appear.
Then select “Edit”.
On the screen that opens, you can edit the existing SQL queries and update them by clicking on the “Update” button on the top right.
Also, if you want to delete the action, click on the “Delete” option in the drop-down menu and complete the process.
Custom actions used in projects cannot be deleted without removing them from the modules or processes they are associated with and an error message may be displayed in this case.