User Manual

Sub Array

1/8/25
Sub Array

Sub Array is an action that allows you to create a new sub-array by taking a specific part of an array on the Kuika platform. This feature is particularly useful for splitting, filtering, or performing operations on specific sections of data when working with large datasets.

Technical Features

  • Create Sub-Arrays: Creates a sub-array based on specific start and length values of an array.
  • Simplifies Data Management: Allows you to divide large data sets into smaller, meaningful, and processable pieces.
  • Dynamic Data Processing Support: Provides a flexible and reusable structure when working with data from different sources.
  • Web and Mobile Application Support: The Sub Array action is compatible with web and mobile applications.

Sub Array Action Application Steps

  1. Log in to the Kuika platform.
  2. Select the project you want to work on from the Apps screen.
  3. Open the screen you want to work on in the UI Design module.
  4. Open the Properties panel on the right side.
  1. From the + ADD ACTION menu, add the String > Sub Array action according to the trigger event you want (Initial Actions, OnClick, OnBlur, etc.).
  2. Configure the following fields in the settings panel that opens:
  • Value: Specifies the main array on which the operation will be performed.
  • Starting Index: The index number where the sub-array will start. (Arrays start from 0.)
  • Count: The number of elements to be included in the sub-array. (In other words, it specifies how many elements will be taken.)

Use Case: Retrieving the Last 5 Items from the Order List

In an e-commerce application, the user wants to see their last 5 purchases.

The Sub Array action is used to display only the last 5 items from an array containing all orders registered in the system.

Scenario flow:

  • The orders array containing all orders is retrieved.
  • The number of orders placed by the user is checked.
  • The Starting Index and Count fields are set to 5.
  • Thanks to the Sub Array action, only the last 5 orders are displayed on the screen.

Sub Array Action Advanced Customizations

  • Dynamic indexing: By setting the starting index according to the result of another action, conditional splitting can be performed.
  • Conditional subarrays: Elements can be retrieved only from the beginning, middle, or end of the array under certain conditions.
  • Sorting & filtering combination: The Sub Array action can be used in conjunction with sorted or filtered arrays to obtain meaningful subgroups.

Technical Risks

  • Invalid Index Range: Make sure that the Starting Index and Count values do not exceed the size of the array. Otherwise, the system may return an error or return an empty array.
  • Use of Negative Values: The use of negative Starting Index or Count values is not supported by the system and may cause unexpected behavior.
  • Empty or Undefined Array: If the main array passed to the Value field is empty or undefined, the Sub Array action may not work. In this case, the array should be checked for emptiness first.
  • Incorrect Binding of Dynamic Sources: When using the Symbol Picker, incorrect data binding (e.g., string instead of number) may cause the subarray to function incorrectly or return an error.
  • Subarray with Zero Elements: If the Count value is set to 0, the action will not return any data. This may sometimes result in no data being displayed to the user.

Sub Array is an effective way to control your data sets and improve the user experience by displaying only the necessary data on the UI. It is an indispensable action, especially for listing, pagination, and summary displays.

Other Related Content

No items found.

Glossary

No items found.

Alt Başlıklar