conditional
Description
Validates the condition passed.
Input / Parameter
condition
The condition to be validated.
Boolean
false
-
No
yesValue
The output value if condition is 'true'.
Any
-
-
No
noValue
The output value if condition is 'false'.
Any
-
-
No
extra
The stored value that is passed to all the callbacks.
Any
-
-
No
Output
Returns the 'yesValue' or 'noValue'.
Any
Callback
yesCallback
The action performed if the condition is true.
noCallback
The action performed if the condition is false.
Example
In this example, we will pass a condition to check whether two values are equal using the Logic.equal function and print the result of the Control.conditional function in the console.
Steps
Drag a
buttoncomponent into the canvas and open theActiontab. Select thepressevent of the button and drag theControl.conditionalfunction to the event flow.Call the function
Logic.equalin theconditionparameter of the function. Enter the parameters of theLogic.equalfunction.value1: 20 value2: 20
Call the function
Log.writein bothyesCallbackandnoCallbackparameters of theControl.conditionalfunction. Change the parameter type of thevalueparameter toinput.
Result
The console will print
YES.
Last updated