# 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*.

#### 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="https://1085786630-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWv5M2BoEVu0kDIV5EPs4%2Fuploads%2Fgit-blob-ae866baad7fa258c51f6357d6c78b6987bd96155%2Fgrafik.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1085786630-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWv5M2BoEVu0kDIV5EPs4%2Fuploads%2Fgit-blob-f5be56a42b3d6284dc41b5ab7dc456815ea8304e%2Fgrafik.png?alt=media" 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.

<figure><img src="https://1085786630-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWv5M2BoEVu0kDIV5EPs4%2Fuploads%2Fgit-blob-0c162caa330977b473621e1b4fc069b334d4c7c6%2Fgrafik.png?alt=media" alt=""><figcaption></figcaption></figure>
