> For the complete documentation index, see [llms.txt](https://docs.emobiq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.emobiq.com/emobiq-client/006-actions-and-visual-logic/action-reference/cordova/flow/conditional.md).

# conditional

## Description

Checks whether the condition passed is met and executes the callback functions accordingly.

## Input / Parameter

| Name      | Description                                     | Input Type  | Default | Options | Required |
| --------- | ----------------------------------------------- | ----------- | ------- | ------- | -------- |
| condition | The condition to be checked against.            | String/Text | -       | -       | Yes      |
| yesValue  | The output value if condition is 'true'.        | Any         | -       | -       | No       |
| noValue   | The output value if condition is 'false.        | Any         | -       | -       | No       |
| extra     | Extra parameters stored and passed to callback. | Any         | -       | -       | No       |

## Output

| Description                          | Output Type |
| ------------------------------------ | ----------- |
| Returns the 'yesValue' or 'noValue'. | Any         |

## Callback

### yesCallback

The function to be executed when the condition passed is 'true'.

### noCallback

The function to be executed when the condition passed is 'false'.

## Video

Coming Soon.

## Example

The user wants to prove that the value `13` is greater than the value `1` and see the result in the console.

### Step

| No. | Description                                                       |                                                                                                                                                                                                                          |
| --- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 1.  | ![](/files/eTq33mcwvg0XKqmps5ZQ) ![](/files/WTDvhuHnTJQmDWMHNXNs) | Drag a button to a page in the mobile designer. Select the event `click` for the button and drag the `conditional` function to the event flow. Select the `function` parameter input type for the `condition` parameter. |
| 2.  | ![](/files/PBiqQXumQCNrrhpQF2qE)                                  | Drag the function `greater` to the subflow.                                                                                                                                                                              |
| 3.  | ![](/files/zT59uKmeSSH206POVjci)                                  | Fill in the inputs of the `greater` function.                                                                                                                                                                            |
| 4.  | ![](/files/t1wghzLhlwriZ3aNIjgI)                                  | Drag the function `console` to the `yesCallback` and `noCallback` nodes of the `conditional` function.                                                                                                                   |
| 5.  | ![](/files/Z06jTc4FVEMT1bWRQIyT) ![](/files/aTVN9tgNhn7sUkl31vCc) | The `console` function in `yesCallback` should return 'greater' while the `console` function in `noCallback` should return 'not greater'.                                                                                |

### Result

When the button is pressed, the console will print 'greater'.

## Links
