If
If
is one of the very basic concepts in programming. For example:
If
today is workday, go to work, else go to sleep.If
the temperature is greater than 30, turn on the AC.
and so on
Add Node
Right-Click anywhere on canvas, select Flow Control/If
Connect Node
Based on Condition
, the flow of our program will go either True
or False
, we can add separate nodes for each branch:
Try
Click the checkbox next to Condition
and see the result
Dynamic Condition
Sometimes we need to use the result of other nodes to determine the branch, for example:
Try
Change the values in Equal
node and see the result
Nested If
In some cases, we need to use If
inside another If
to achieve the following logic: if ..., else if ..., else ...
, we can do this by using nested if, for example:
TIP
There is no constraints for the depth of nested If
, however a good practice is to keep the depth of nested If
as small as possible