Kullanıcı Kılavuzu

If Then Else

If Then Else

The If Then Else action allows you to define different action paths based on specific conditions in the Kuika platform. It is used to manage logical decisions within the application and create dynamic workflows. If the condition is true, the actions in the ‘If’ section are executed; if false, the actions in the ‘Else’ section are executed. The action is supported in both web and mobile applications.

Technical Features

  • Condition-Based Redirection: Different actions can be applied based on the specified condition.
  • Condition Evaluation: When the condition in the If block is met, the actions in that block are executed.
  • Alternative Action: If the condition is not met, the actions in the Else block are executed.
  • Web and Mobile Compatibility: The action works seamlessly on both apps.
  • Dynamic Workflow: Flexible decisions can be made based on the data status within the application.

If Then Else Action Implementation Steps

Adding the If Then Else Action to the Project

  1. Open your project in Kuika.
  2. Select the relevant screen from the UI Design module.
  3. Select a component (e.g. a button) and open the Properties panel.
  1. From the + ADD ACTION menu, select an appropriate trigger action (event) such as Initial Actions, OnClick, OnBlur, then select Condition → If Then Else.

Configuring the If Then Else Action

In the menu that opens, you can configure the following fields to create condition-based workflow:

  • Will Execute If: The area where the condition is checked. If true, the If block is executed; if false, the Else block is executed.
  • If Actions: Actions to be executed if the condition is true.
  • Else Actions: Actions to be executed if the condition is false (optional).

These actions can include system or custom actions such as page redirection, data updating, or displaying warnings.

In other words, what you are doing here is creating an ‘if-then’ structure: If the specified condition is met → perform these actions, otherwise → perform these actions.

All Common Condition Descriptions

  • Is Equal To: The condition is met if the value is exactly equal to the specified value.
  • Example: ‘User Name’ = ‘email’
  • Is Not Equal To: The condition is met if the value is different from the specified value.
  • Example: ‘Role’ ≠ ‘Administrator’
  • Is Empty: The condition is met if the value is empty (null or empty string).
  • Is Not Empty: The condition is met if the value is not empty.
  • Is In List: The condition is met if the value is in the specified list. Example: ‘Status’ ∈ [‘New’, ‘Awaiting Approval’]
  • Starts With: The condition is met if the value starts with the specified text.
  • Example: “abc123” → starts with ‘abc’
  • Does Not Start With: The condition is met if the value does not start with the specified text.
  • Contains: The condition is met if the value contains the specified text.
  • Example: ‘abc123’ → contains ‘c1’
  • Does Not Contain: The condition is met if the value does not contain the specified text.
  • Ends With: The condition is met if the value ends with the specified text.
  • Length Shorter Than: The condition is met if the character length is shorter than the specified length.
  • Length Shorter Or Equal To: The condition is met if the character length is equal to or shorter than the specified value.
  • Length Longer Than: The condition is met if the character length is longer than the specified value.
  • Length Longer Or Equal To: The condition is met if the character length is equal to or longer than the specified value.
  • Length Equal To: The condition is met if the character length is equal to the specified value.
  • Is Guid: The condition is met if the value is in a valid GUID (unique identifier) format.
  • Example: 123e4567-e89b-12d3-a456-426614174000

Condition Types and Usage Descriptions

Now (Current Date-Time)

  • Used for time comparisons:
    • Is Earlier Than / Or Equal: The condition is met if the current time is earlier than or equal to the specified date.
    • Is Later Than / Or Equal: The condition is met if the current time is later than or equal to the specified date.
    • Empty / Null / Space (Space Checks)
  • Checks whether text fields are empty or conform to specific formats.
  • Can be used with all common operators listed above.

True / False (Boolean Fields)

  • Can only be used with the following operators:
    • Is Equal To
    • Is Not Equal To
    • Is Empty
    • Is Not Empty
    • Is In List
  • Example: For the ‘Active?’ field

New Guid / Empty Guid

  • The GUID format is checked.
  • The Is Guid operator is used specifically in this field.

Current User Name

  • The name of the user logged into the system is checked.
  • Can be used with all text-based operators.

Client IP Address

  • Used for IP address checks.
  • Can be checked with text operations such as start, end, and contain.

Version Info

  • Text checks are performed to compare application or system versions.

Role List (User Role)

  • For example, comparisons can be made with roles such as ‘Manager’ and ‘Personal’.

If-Then-Else Structure

  • If: One of the above condition types is selected.
  • Then: This block runs if the condition is met.
  • Else: This block runs if the condition is not met.

If Actions

  • Type: Action
  • Required: Yes
  • Description: Allows you to select actions to be executed when the condition is true.
  • Input: Usually defined using data sources such as Action Result, Current, Form Component, Screen Input or Fixed, and can be linked via the Symbol Picker.

Else Actions

  • Type: Action
  • Required: Optional
  • Description: Allows you to select alternative actions to be executed when the condition is false.
  • Input: Usually defined using data sources such as Action Result, Current, Form Component, Screen Input or Fixed, and can be linked via the Symbol Picker.

Use Case: Screen Redirection Based on User Role

In an application, you may want to redirect users to different screens based on their roles (e.g., Admin, User, Guest). Kuika's If Then Else action allows you to easily perform such role-based redirection. With this action, the role of the user logging into the application is checked, and they are redirected to the appropriate screen. This provides a personalised experience for the user and ensures authorisation management.

Add the If Then Else Action

  1. Log in to the Kuika platform.
  2. Open the project you want to work on from the Apps screen.
  1. While in the UI Design module, open the Properties panel on the right side.
  2. Select the component you want to add the action to (e.g., the ‘Log In’ button).
  3. Follow these steps from the + ADD ACTION drop-down menu: 
    • Onclick → Condition → If Then Else.

Configure If Then Else Parameters

In the window that opens, configure the following fields:

The ‘Will Execute If’ field is the section that checks whether the condition you defined is true. Here, you write a condition that specifies in which case the system will execute the ‘If Actions’ section. If this condition is met, the ‘If Actions’ will be executed.

If it is not met, i.e. if the condition is false, the ‘Else Actions’ are executed.

Example usage

  • Condition (Will Execute If): data.user.role == “Admin”
  • If Actions: Navigate to AdminPanel
  • Else Actions: Navigate to UserPanel

In this example:

  • If the user's role is ‘Admin’ → Redirect to the AdminPanel screen.
  • If not → the user is redirected to the UserPanel screen.

What Types of Conditions Can I Write?

In the ‘Will Execute If’ field, you can write

  • Text comparisons (==, !=, contains, starts with)
  • Space checks (is empty, is not empty)
  • Date/time comparisons
  • List checks
  • GUID validations
  • You can write logical expressions such as these.

If Actions: You can define the actions to be performed if the condition is true here.

Example: If the condition ‘data.user.role’ = ‘Admin’ is met, redirect to the AdminPanel screen.

Else Actions: You can specify the actions to be performed if the condition is false.

Example: If the user is not an admin, redirect to the UserPanel screen.

If Then Else Action Advanced Customizations

Dynamic Redirection:

Redirection can be made based on the user's profile or transaction history.

Condition Creation Sources:

  • Action Result (result of the previous action)
  • Form Component, Screen Input, Fixed values
  • Symbol Picker (data binding tool) can be used to determine this.

Action Entry Configuration:

  • If Actions: Required. Actions to be performed when the condition is met.
  • Else Actions: Optional. Actions to be performed when the condition is not met.

Post-Action Usage

  • The condition is evaluated.
  • If true, the If block is executed; if false, the Else block is executed.
  • A user-specific process flow is created.

Technical Risks and Recommendations

  • Condition Errors: Ensure that condition statements are written correctly.
  • Missing Alternative Flow: If the Else block is not defined, no action is taken when the condition is not met.
  • Performance: Multi-layered conditions can cause slowdowns; keep them simple.

The If Then Else action enables you to make conditional decisions in your application. It enhances the user experience by creating flexible process flows based on user interactions and application data. It is an effective tool for redirection, form validation, and approval processes.

Other Related Content

No items found.

Glossary

No items found.

Alt Başlıklar