> ## Documentation Index
> Fetch the complete documentation index at: https://help.dingtalk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# IF

> The IF function is used for conditional evaluation and can be applied to multiple YiDA scenarios, such as forms and workflow design. It returns different values based on whether a logical expression is true or false.

The **IF** function is used for conditional evaluation. It returns one value if the condition is met, and another value if it is not.

## Supported Product Scenarios

The IF function is supported in the following YiDA scenarios:

* Form (main table fields)
* Form (business association rules)
* Form (validation)
* Workflow design (validation rules)
* Workflow design (association actions)
* Integration & automation
* Workflow node
* Connector

## Format

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
IF(condition,value1,value2)
```

## Attribute Description

| **Attribute** | **Required** | **Description**                                                        |
| ------------- | ------------ | ---------------------------------------------------------------------- |
| condition     | Yes          | The logical expression used for evaluation.                            |
| value1        | Yes          | The value returned when the logical expression evaluates to **true**.  |
| value2        | Yes          | The value returned when the logical expression evaluates to **false**. |

## Return Value

The return value is either value1 or value2 from the `IF()` function.

* Returns value1 when the condition evaluates to true.
* Returns value2 when the condition evaluates to false.

## Example

Returns "Fail" for scores below 60, and "Pass" for scores of 60 or above.

Returns "Qualified" when the scores in Chinese, Math, and English are all 60 or above; returns "Unqualified" if any of the three scores is below 60.
