Create SQL Select Query Automatically with Select Action

  1. After logging into the Kuika platform, open the project you will work on from the "Apps" screen. 
  1. In the "UI Design" (1) module, open the "Custom Actions" (2) panel on the left side.
  2. Select "Select Action" (3) in the drop-down menu with the "+" icon next to the ManagedDB title.
  3. In the window that opens, name the query you want to create. 
  4. Click the "+" icon to select the data source of the action. You can use a table you created before as the data source of the Select action. 
  5. After selecting the table, you can define Fields, Filter and Sort order fields according to your needs.

Make Select Action Tab Settings

  1. Relations: You can select the data source for the action you want to create from the Relations field. You can select one of the tables you created before as the data source and associate the table you selected with different tables.

  1. Fields: After selecting the information you want to list from the Fields field and the tables where they are located, you can change the default Group By function for each information with Count, Min and Max, and you can use Alias for the fields you add. 
  • Group by: It allows you to make bulk calculations by grouping data according to certain columns in SQL.
  • Count: Calculates the number of values in a given column or the number of items in all rows under the Group by tab. 
  • Min: Finds the lowest value in a given column.
  • Max: Finds the highest value in a given column. 
  • Alias: An alias used in SQL to give shorter or more meaningful names to columns or tables. 
  1. Filter: It is used to select data that meet certain criteria or conditions and filter the query results. For example; if you want to filter employees with a certain title in a department, you can set the "DepartmentName" field as "Design" and the "Title" field as "Team Leader". By combining these conditions with the "AND" operator, you can select only the employees who are "Team Leader" in the "Design" department. In another example, you may want to filter employees in two specific departments. In this case, you can specify the "DepartmentName" field as "Design" or "Marketing". By combining these conditions with the "OR" operator, you can select all employees working in the "Design" or "Marketing" department. 

By creating AND or OR groups, you can use the WHERE function to create logical connections in data filtering or queries. 

  • AND: It is used when more than one condition must be met at the same time. 
  • OR: It is used when it is sufficient to fulfil any one of more than one condition.
  1. Sort order: It allows the query results to be sorted according to a certain criterion. You can sort the data you want in ascending or descending order. 
  1. Preview: Allows you to preview the query you have created. 

When there is no data stored in the relevant data table, the preview field is empty. (!) After clicking Convert to SQL Action, you cannot return to Select Action mode again, you can use SQL Editor for related editing operations. 

  1. Click the "CREATE" (1) button in the lower right corner to complete the Select Action creation process.