conditional
Description
Validates the condition passed.
Input / Parameter
Name | Description | Input Type | Default | Options | Required |
---|---|---|---|---|---|
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
Description | Output Type |
---|---|
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
button
component into the canvas and open theAction
tab. Select thepress
event of the button and drag theControl.conditional
function to the event flow.Call the function
Logic.equal
in thecondition
parameter of the function. Enter the parameters of theLogic.equal
function.Call the function
Log.write
in bothyesCallback
andnoCallback
parameters of theControl.conditional
function. Change the parameter type of thevalue
parameter toinput
.
Result
The console will print
YES
.
Last updated