white-logo

KappaX

burger-icon
search-icon

/

Rules

KappaX is a powerful platform that allows you to create interactive content without the need for coding skills. With KappaX, you can create engaging experiences for your audience using simple drag-and-drop tools. In this article, we’ll explore how to create rules using the AND and OR conditions in KappaX.

Understanding Rules

Rules are the conditions based on which we can write actions. These conditions can be a single condition or multiple conditions grouped together. The AND function ensures that all conditions must be true before executing the action, whereas the OR function only requires one condition to be true to execute the action. By using AND and OR functions, you can create complex logic blocks that execute actions based on specific conditions.

Let’s understand this using an example. We have two custom attributes predefined, 'VideoStatus' which tracks the status of the video, and 'InteractClick' which tracks whether the 'Interact Now' button has been clicked or not. If the button is clicked, its value will be 1, and if not clicked, its value will be 0.

Rules1

Executing AND Function

To create rules using the AND function, we'll select the video element, switch to the logic panel, and select the click event. In the rules, we'll check if 'VideoStatus' is equal to play. And in the action, we'll say hide Image. Switch to preview mode, click on the video element on which we’ve written the logic, and it works!

Rules2

Now, let’s add one more condition. Going back to the editing mode, select the layer & add a new condition. Is 'InteractClick' equal to 3 (this will never be true). We have multiple conditions now, and we'll group them with the AND function. Switch to preview mode and check again. This time, the action didn't execute. This is because the AND function ensures that the logic block gets executed only when all the mentioned conditions are true.

Rules3

Executing OR Function

To create rules using the OR function, we'll again select the video element, switch to the logic panel, and select the click event. In the rules, we'll check if 'VideoStatus' is equal to play. And in the action, we'll say show Image. Switch to preview mode, click on the video element, and it works!

Rules2

Now, let’s add one more condition. Going back to the editing mode, select the layer & add a new condition. Is 'InteractClick' equal to 3. We have multiple conditions now, and we'll group them with the OR function. Switch to preview mode and check again. This time, it worked! Because using the OR function, the logic block gets executed even if a single condition statement is true.

Rules4

On this page

Understanding Rules

Executing AND Function

Executing OR Function