2. Using Swagger API Actions on the Application Screen
Now you can add the actions defined in Kuika Swagger API to your application and use them in various screens. In this example, we will create a table screen where product stocks are listed.
Creating a List Screen: Prepare a list screen to show product stocks.
Add a Table element from the Elements panel in the UI Design module and drag and drop it to the screen.
Name the columns of the table in a meaningful way. For example: ID, Stock Code, Product Name, Barcode.
Adding an Action - Initial Action: Define an Initial Action for a Table element to automatically pull stock information from the API each time the product stock screen is opened.
Click the +ADD ACTION button from the Properties panel on the right side.
Follow the path Initial Actions > Custom > Datasource.
Select the Stock Get Product List From Rest action under the Rest heading. This action pulls product stock information from the API.
Linking Table Data Source: Select the table and set the data source to link the data pulled with the action to the table on the list screen.
To set the data source of the table, select the table and go to the Properties panel on the right.
Select the Stock Get Product List From Rest action under the Action heading from the Datasource menu.