CUSTOM ACTION AND DATA BINDING

Create SQL action for mobile application

In this learning content, we will create custom actions that we will use in the mobile application we are developing.

In this learning content, we will create custom actions that we will use in the mobile application we are developing.

The data tables you create in Kuika are not application-specific but workspace-specific. In other words, you can use the data table you create in one application in another application.

Within the scope of this sample application, we can use the data tables we use in the web application when creating custom actions.

First, let's start with the custom actions we will use on the Dashboard screen.

Let's create a TotalEmployee action for the Total number of employees on the Dashboard screen as in the web application.

Open the Custom Actions panel.

Using the query text below, create a TotalEmployee SQL action that will give the total number of employees in the Employee table.

select Count(Id) as TotalEmployee from Employee

To create another custom action, TotalDepartment, open the Custom Actions panel and create the TotalDepartment SQL action using the query text below.

select Count(Id) as TotalDepartment from Department

On the Dashboard screen, create the SelectEmployeebyDate action with the Custom Actions panel to list the recently added employee in a similar way to the web application. You can see the SQL query that creates the action below.

select e.FullName, e.Id , EmployeeImage, d.DepartmentName
from Employee e
left join Department d on d. Id = e.Department
order by CreatedDate desc

We have created the actions needed for the Dashboard screen.

Let's continue by creating actions for another screen, the list screen.

We have a search box on the list screen. This search box will search the list according to the value typed in it.

In this direction, let's create an action called SelectEmployeeBySearch through the Custom Actions panel. The SQL query shown below will be enough to create the action. But you can change the action according to your needs.

select e.*,d.DepartmentName from employee eleft join Department d on d.Id =e.Department
WHERE FullName LIKE @searchFor OR @searchFor is null OR @searchFor = '''

Now, let's create the action we need for the employee detail screen.

Create an action named SelectEmployeeById using the Custom Actions panel. You can use the SQL query on the screen while creating the action.

select e.*, d.DepartmentName,t.Title as titleName from employee eleft join Department d on d.ID = e.Departmentleft join Title t on t.Id = e.Titlewhere e.Id = @Id

Finally, let's create an SQL action to retrieve user information on the profile screen. Create the SelectProfile action using the query below.

This action accepts the e-mail address of the employee added in the web application as a condition. Therefore, in the mobile application, the employee should use their e-mails in the employee management system when registering to the application.

select e.*, d.DepartmentName,t.Title as titleName from employee eleft join Department d on d.ID = e.Departmentleft join Title t on t.Id = e.Titlewhere e.Email = @kuikausername

In this learning content, we will create custom actions that we will use in the mobile application we are developing.

In this learning content, we will create custom actions that we will use in the mobile application we are developing.

The data tables you create in Kuika are not application-specific but workspace-specific. In other words, you can use the data table you create in one application in another application.

Within the scope of this sample application, we can use the data tables we use in the web application when creating custom actions.

First, let's start with the custom actions we will use on the Dashboard screen.

Let's create a TotalEmployee action for the Total number of employees on the Dashboard screen as in the web application.

Open the Custom Actions panel.

Using the query text below, create a TotalEmployee SQL action that will give the total number of employees in the Employee table.

select Count(Id) as TotalEmployee from Employee

To create another custom action, TotalDepartment, open the Custom Actions panel and create the TotalDepartment SQL action using the query text below.

select Count(Id) as TotalDepartment from Department

On the Dashboard screen, create the SelectEmployeebyDate action with the Custom Actions panel to list the recently added employee in a similar way to the web application. You can see the SQL query that creates the action below.

select e.FullName, e.Id , EmployeeImage, d.DepartmentName
from Employee e
left join Department d on d. Id = e.Department
order by CreatedDate desc

We have created the actions needed for the Dashboard screen.

Let's continue by creating actions for another screen, the list screen.

We have a search box on the list screen. This search box will search the list according to the value typed in it.

In this direction, let's create an action called SelectEmployeeBySearch through the Custom Actions panel. The SQL query shown below will be enough to create the action. But you can change the action according to your needs.

select e.*,d.DepartmentName from employee eleft join Department d on d.Id =e.Department
WHERE FullName LIKE @searchFor OR @searchFor is null OR @searchFor = '''

Now, let's create the action we need for the employee detail screen.

Create an action named SelectEmployeeById using the Custom Actions panel. You can use the SQL query on the screen while creating the action.

select e.*, d.DepartmentName,t.Title as titleName from employee eleft join Department d on d.ID = e.Departmentleft join Title t on t.Id = e.Titlewhere e.Id = @Id

Finally, let's create an SQL action to retrieve user information on the profile screen. Create the SelectProfile action using the query below.

This action accepts the e-mail address of the employee added in the web application as a condition. Therefore, in the mobile application, the employee should use their e-mails in the employee management system when registering to the application.

select e.*, d.DepartmentName,t.Title as titleName from employee eleft join Department d on d.ID = e.Departmentleft join Title t on t.Id = e.Titlewhere e.Email = @kuikausername

Yardımcı kaynaklar

Glossary