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
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
In this example:
What Types of Conditions Can I Write?
In the ‘Will Execute If’ field, you can write
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.