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

> IF函数用于条件判断，支持在宜搭的多种场景中使用，如表单、流程设计等。根据逻辑表达式的真假返回不同的值。

**IF**函数用于条件判断，如果满足条件则返回一个值，如果不满足，则返回另外一个值。

## 支持产品场景

IF函数支持在宜搭的以下场景中使用。

* 表单（主表字段）
* 表单（业务关联规则）
* 表单（校验）
* 流程设计（校验规则）
* 流程设计（关联操作）
* 集成自动化
* 流程-节点
* 连接器

## 格式

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

## 属性说明

| **属性**    | **是否必填** | **说明**                  |
| --------- | -------- | ----------------------- |
| condition | 是        | 用于判断的逻辑表达式。             |
| value1    | 是        | 逻辑表达式的值为**true**时的返回值。  |
| value2    | 是        | 逻辑表达式的值为**false**时的返回值。 |

## 返回值

返回值是`IF()`函数中的value1或value2的值。

* 逻辑表达式condition的值为 true 时，返回value1。
* 逻辑表达式condition的值为 false 时，返回value2。

## 体验

小于 60 分返回不及格，否则大于等于 60 分返回及格。

<Frame>
  ![](https://yida-support.oss-cn-shanghai.aliyuncs.com/static/gif/1703584899374-a061c0aa-7f93-4a1f-93e1-eef391e99264.gif)
</Frame>

语数外三科成绩同时大于等于60返回合格，其中有一科分数小于60则返回不合格。

<Frame>
  ![](https://yida-support.oss-cn-shanghai.aliyuncs.com/static/gif/1703584991494-f90df30c-0d41-4bb3-9439-9ee8576007ed.gif)
</Frame>
