# 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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.emobiq.com/emobiq-client/006-actions-and-visual-logic/action-reference/cordova/flow/conditional.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
