Create custom actions with SQL editor in Datasources mode

You can create special actions in an application you develop with Kuika and use the actions you create on screens.

1. Creating a Custom Action Using SQL Editor

To create a custom action, open the Datasources view mode.

Datasources Ekranı

Through the left menu in Datasources view mode, you can view the data sources, actions and tables in the application you have developed, add a new data source, a new action and a new table.

To add a new custom action, hover over the Actions sub-panel with the cursor. Click on the ‘+’ icon next to the Actions sub-panel.

Actions alt sekmesi öğeleri ekran görüntüsü

You can create a New SQL Action or a New Folder via the drop-down menu. If you want to create a new Custom Actions under the Actions sub-panel, click New SQL Actions. If you want to create Custom Actions under a new file, click New Folder and create the file by naming it.

Let's create an action that allows listing the departments in a personnel list within the scope of a sample scenario. Before creating this action, you must create a table named Department. You can examine our related content in detail for table creation operations.

You are expected to list the departments in the application on the department listing screen. For this, create a custom action named SelectDepartmentList.

SQL Editör ile aksiyon oluşturma ekranı ekran görüntüsü

A SQL Editor will greet you on the screen that opens. Write the SQL query required for listing in the SQL Editor.

Kuika provides you some convenience in adding queries. This convenience creates automatic queries specific to tables on the query insertion screen.

To add automatic queries specific to the table, hover over the tables in the left menu on the query insertion screen. Click on the three dots next to the table. Kuika allows you to automatically add and modify Select, Update and Delete queries.

You can use the following query to list the departments with SelectDepartmentList special action.

Copyselect * from Department  WHERE DepartmentName LIKE @searchFor  OR @searchFor is null OR @searchFor = ''  ORDER BY DepartmentName 

After writing the query, you can test the query via the TEST button in the upper right corner and create the special action by clicking the CREATE button.