Kullanıcı Kılavuzu

For Each

For Each

For Each is a loop (iteration) action that performs defined actions on each item in a list or collection in sequence. It is frequently used in Kuika applications for repetitive data processing scenarios. It allows you to perform actions on database results, user selections, or lists from external data sources.

Technical Features

  • Loop Over List: Performs operations on the defined list elements in order.
  • Current Row Access: Each item is accessed by default through the Current symbol. However, if desired, a specific name can be given to the item within the loop and used with that name.
  • Action Chaining: Multiple actions can be defined for each item in the loop.
  • Conditional Processing: A specific condition can be set for each item, and sub-actions can be executed according to this condition.
  • Database Integration: A loop can be created on data coming from the database.

For Each Action Application Steps

1. Add the For Each Action

  • Log in to the Kuika platform.
  • Open your project from the Apps screen.
  • Go to the UI Design module.
  • Select the button, page, or action chain where you want to start the loop.
  • + ADD ACTION menu, select the trigger event (Initial Actions, OnClick, etc.) that suits your needs and add the Condition > For Each action.

2. Define the List

  • Data from data sources such as Action Result can be transferred to this area first. Other sources such as Method Input, Current, Screen Input, Fixed, or Component can also be used. These categories can be selected and defined using the Symbol Picker.

3. Define Actions for the Loop

  • Define the actions to be triggered for each item in For Each.
  • The Current symbol is used to access the relevant item in the actions:
    • Current.Name, Current.Email, Current.Price, etc.

Use Case: Disabling Inactive Users

Scenario: In the administrator panel, a list of users that ‘need to be disabled’ is obtained based on certain criteria. The Disable User action is executed for each user.

Application Flow

  • Element: ‘Disable’ button
  • Trigger: OnClick
  • Actions:
    • Condition → For Each
      • List: ActionResult.passiveUsers
      • Internal Action: Authorisation → Disable User
        • User Name

For Each Action Advanced Customisations

  • Nested For Each: If there is a product list for each user, it can be managed with a two-layered For Each structure.
  • Conditional Actions: Conditional control can be performed for each item with the If structure.
  • Dynamic Action Generation: The operations within For Each can be integrated with many actions such as Switch, Assign, Update, Navigate.

Technical Risks and Controls

  • Empty List: If the list to be processed by For Each is empty, the internal actions will not execute. The list length should be checked.
  • Performance: Processing long lists sequentially may affect performance. Delay management may be required.
  • Synchronisation Issue: If a synchronisation structure is not established within the action chain, data transfers may not work correctly.

For Each is a powerful control structure in Kuika for repetitive data processing. It has a wide range of applications, from managing user lists to processing products, database updates, and cyclic screen updates. It provides direct access to data using the Current symbol and allows specific actions to be performed on each row.

Other Related Content

No items found.

Glossary

No items found.

Alt Başlıklar