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

# XOR

> The XOR function represents exclusive OR and is used to compare logical expressions. This page describes the use cases, format, attributes, return value type, and usage examples of the XOR function.

The **XOR** function represents exclusive OR.

XOR is used to compare logical expressions. The function returns true only in the following case.

* When exactly one logical expression is true and all others are false, the XOR function returns true.

## Supported Product Scenarios

The XOR function is supported in the following YiDA scenarios.

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

## Format

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
XOR(condition1,condition2....condition.N)
```

## Attributes

<table>
  <tr>
    <td>**Attribute**</td>
    <td>**Required**</td>
    <td>**Description**</td>
  </tr>

  <tr>
    <td>condition1</td>
    <td>Yes</td>
    <td rowSpan={2}>The logical expression or condition to evaluate.<br /><ul><li>When exactly one logical expression is true and all others are false, the XOR function returns true.</li></ul></td>
  </tr>

  <tr>
    <td>condition2</td>
    <td>Yes</td>
  </tr>
</table>

## Return Value

| **Return value type** | **Description**                   |
| --------------------- | --------------------------------- |
| Boolean               | The return value of the function. |

## Example

As shown below, the `XOR()` function returns **true** only when the value of `Numerical 1` is greater than 2 and the value of `Numerical 2` is less than or equal to 2.
