Bag Has Key

Bag Has Key

Bag Has Key action is used to check whether a bag defined on the Kuika platform exists. This action is used to set up conditional action flows before bag operations, develop user-specific bag logic, or pre-validate the contents of the bag. It plays an important role in scenarios such as conditional visibility, button activity, or automatic redirection.

Technical Features

  • Bag Existence Check: Checks whether a bag with the specified Bag Key exists in the system.
  • Suitability for Conditional Actions: The result returns true or false, and conditional actions can be triggered with this value.
  • Dynamic Values with Symbol Picker: The Bag Key to be checked can be determined dynamically.
  • Web and Mobile Compatibility: The action works on both web and mobile projects.
Bag Has Key Action Application Steps

Defining the Action in UI Design

  1. Log in to the Kuika platform.
  2. Select your project from the Apps screen.
  3. Go to the UI Design module.
  4. Open the screen where you want to check the basket (e.g. Home Page, Basket Button, Checkout Screen).
  1. Add an action to a suitable element (e.g. a button whose visibility is conditional).
  2. + ADD ACTION → select the appropriate trigger (Initial Actions, OnClick, etc.) → Bag → Bag Has Key action.

Configuring Action Parameters

  • Bag Key (Required – Symbol Picker): The key of the cart whose existence will be checked. For example:
    • ‘default’
    • currentUser.id + “_bag”
    • screenInput.selectedCategory + ‘_bag’
  • Bag Key should be obtained dynamically via Symbol Picker based on the user or the situation.
Usage Scenario: Check the Bag and Continue

On a payment screen, when the user clicks the ‘Make Payment’ button, the bag should first be checked for existence. If the bag does not exist, the user should be warned or the action should be cancelled.

Configuration Steps:

  1. Add the action to the ‘Make Payment’ button with OnClick.
  2. As the first action:
    • Bag → Bag Has Key
    • Bag Key: currentUser.id + ‘_bag’
  3. Add the Condition action that checks the result:
    • If true: Continue → Start the payment flow.
    • If false: Notify → ‘Your cart is empty. Please add a product first.’
Bag Has Key Action Advanced Customisations
  • Conditional Button Visibility: If the user has a cart, show the ‘Continue’ button, otherwise hide it.
  • Navigation Conditions: Redirect users without a cart to the shopping screen.

Technical Risks and Precautions

  • Empty Bag Key: If the Bag Key parameter is empty, the system cannot perform the check, and in this case, the action returns nothing.
  • Incorrect Bag Key Format: The Bag Key must be valid and compatible with the shopping cart structure defined in the system.
  • Use of Results Appropriate to the Scenario: Bag Has Key only returns true/false; this value must be processed using conditional redirects.

The Bag Has Key action forms the basis of decision-making mechanisms in functions based on basket logic. When used correctly, it enhances the user experience and ensures that the system operates in a more controlled manner. It is one of the most commonly used controls, especially in ‘continue if available’ type flows.

Other Related Content

No items found.

Glossary

No items found.

Alt Başlıklar