> ## Documentation Index
> Fetch the complete documentation index at: https://rpa.bazhuayu.com/helpcenter/llms.txt
> Use this file to discover all available pages before exploring further.

# If 条件

## 指令说明

**描述：** 判断指定条件是否成立，如果成立，执行 If 条件里面的指令。

<Info>
  该指令需要与 **End If** 指令配对使用，If 和 End If 之间的指令块仅在条件成立时执行。
</Info>

## 参数说明

<Tabs>
  <Tab title="常规">
    <img src="https://mintcdn.com/bazhuayu-rpa-docs/54VOmvcVz9x5vq70/helpcenter/commands/condition/images/01-if-params.png?fit=max&auto=format&n=54VOmvcVz9x5vq70&q=85&s=1f4f716811ae8ff733c940808e5e2b05" alt="If 条件指令参数面板" width="644" height="417" data-path="helpcenter/commands/condition/images/01-if-params.png" />

    | 参数         | 说明                                           |
    | ---------- | -------------------------------------------- |
    | **第一个操作数** | 输入前面指令创建的变量、表达式、文本、数字或符号，与第二个操作数进行比较         |
    | **运算符**    | 下拉选择第一个操作数和第二个操作数之间的关系（大于、小于、等于、不等于、包含、不包含等） |
    | **第二个操作数** | 输入前面指令创建的变量、表达式、文本、数字或符号，与第一个操作数进行比较         |
  </Tab>

  <Tab title="高级">
    本指令暂无高级参数。
  </Tab>
</Tabs>

## 使用示例

<img src="https://mintcdn.com/bazhuayu-rpa-docs/54VOmvcVz9x5vq70/helpcenter/commands/condition/images/02-if-example.png?fit=max&auto=format&n=54VOmvcVz9x5vq70&q=85&s=badee00a28eb1da282f7ffb76b0d2477" alt="If 条件使用示例 - 流程搭建" width="517" height="185" data-path="helpcenter/commands/condition/images/02-if-example.png" />

**该流程执行逻辑：**

使用【If 条件】判断 5 是否大于等于 3

若满足条件，执行【打印日志】，打印消息日志："If 条件成立"

### 效果展示

条件成立时，打印日志输出：`If 条件成立`

<img src="https://mintcdn.com/bazhuayu-rpa-docs/54VOmvcVz9x5vq70/helpcenter/commands/condition/images/03-if-result.png?fit=max&auto=format&n=54VOmvcVz9x5vq70&q=85&s=6010c4ac6002ed30d8a4a11cd5c2dc90" alt="If 条件使用示例 - 效果展示" width="1361" height="290" data-path="helpcenter/commands/condition/images/03-if-result.png" />

## 相关指令

* [Else If 条件](/helpcenter/helpcenter/commands/condition/elseifcommand) —— 条件不成立时判断另一个条件
* [Else](/helpcenter/helpcenter/commands/condition/elsecommand) —— 所有条件不成立时的兜底分支
* [End If](/helpcenter/helpcenter/commands/condition/endifcommand) —— 结束 If 条件块

<Info>
  使用指令过程中遇到问题？前往 [八爪鱼RPA 开发者社区问答板块](https://rpa.bazhuayu.com/community/questions) 提问，获取官方与社区帮助。
</Info>
