# 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="/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.

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


---

# 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.nedyx.com/version-1.66/nedyx/clearlines-functions/logical-functions/if.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.
