> For the complete documentation index, see [llms.txt](https://docs.nedyx.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nedyx.com/version-1.52-preview/clearlines-functions/logical-functions/if.md).

# IF

#### Syntax <a href="#syntax.23" id="syntax.23"></a>

**IF**(*condition; thenExpression; elseExpression*)

* *condition* - the condition which is evaluated *- **Value type**: boolean*
* *thenExpression* - expression which is evaluated if *condition* is *true* - ***Value type**: any*
* *elseExpression* - expression which is evaluated if *condition* is *false - **Value type**: any (optional, default: empty)*

#### Return <a href="#return.2" id="return.2"></a>

The function returns the result of the evaluated *then*- or *elseExpression*.&#x20;

#### Remarks <a href="#remarks.20" id="remarks.20"></a>

* The function can be called with multiple *condition*/*thenExpression* parameter pairs as well. In this case, the evaluation of the functions stops after the first condition which is *true*.\
  If none of the conditions is true, *elseExpression* is evaluated.

#### Examples

<figure><img src="/files/NXQSOSfCBrBVC5GKuh9Q" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/wG4feEM0vYRIWdhl5rul" alt=""><figcaption></figcaption></figure>

In this case, after clicking on the button, table3 is filled with the information if the values of table4 are positive, negative or zero. \
The IF function is used here with 5 parameter, and the result is used to fill a table widget.&#x20;

<figure><img src="/files/mM99dSlcCkbXLCdiVCpG" alt=""><figcaption></figcaption></figure>
