The way to implement conditions in Kodika is to use the If Code Block. You can find the If Code Block in the Blocks->Logic.
You can press the white settings icon to change between different block options.
Each section of the Block consists of the condition (If/Else If) and the actions that will be executed (do).
Note: A special case is the optional else, which doesn’t need a condition and its actions are executed if no prior condition is True.
The condition (IF part) of the section is where you define the condition, using the True/False Boolean Input Parameter. If the condition is true during its evaluation, then the actions in the Do section will be executed.
In the Do section, you will need to add the Code Blocks of the actions that you want to be executed when the condition is True. You need to use Code Blocks with Code Block Connection.
To check for more than one condition, you will need to add an Else If section from the block options. You can have unlimited Else If sections but only one Else section.
Note: Using Else if is different than using multiple If Code blocks. Using the Else if section, the condition is checked only if the previous condition is false.
The Else section actions are executed if none of the If and Else if conditions are true. It is common to use the else when you want to execute actions when the If condition is false.
Tip: Else section is optional.
In the next example, the background color of the View is changed based on the Text Field’s text value. The special else case will be executed when the other conditions are not true and it will change the Button’s title to