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

# arc:if

> Evaluates expressions containing items, attributes, and values, executing the body block when the expression evaluates to true.

export const siteNameShort = "Arc";

Use the `arc:if` keyword to evaluate expressions that can contain items, attributes, and values. The scope of the keyword is executed if the specified expression evaluates to `true`.

## Parameters

* **exp**: The expression to evaluate. You can make string, date, and numeric comparisons.
* **attr**: The name of the attribute to compare the value of. The value of an attribute can be checked for a matching value or for the values `null` or `notnull`.
* **value**: The value to compare with the value of the attribute specified by **attr**.
* **item**: The item that contains the attribute being compared.
* **operator**: The name of the operator to compare the operands specified by **attr** and **value**. Allowed values: `null`, `notnull`, `hasvalue`, `equals`, `equalsignorecase`, `notequals`, `lessthan`, and `greaterthan`. The default is `notnull`.
* **action**: The action to perform if the expression evaluates to `true`. Allowed values: `break` or `continue`.

## Control Attributes

None

## Examples

Evaluate a simple comparison of two values:

```xml theme={null}
<arc:if exp="[attr] == 10">
```

Evaluate the equality of a given value and the value of a given attribute:

```xml theme={null}
<arc:set attr="attr1" value="value1"/>
<arc:set attr="attr2" value="value2"/>
<arc:if attr="attr1" value="[attr2]" operator="notequals"> <!-- Evaluates to true -->
<arc:else>
False
</arc:else>
True
</arc:if>
```

Evaluate whether an attribute exists:

```xml theme={null}
<arc:set attr="exists" value="true"/>
<arc:if attr="exists"> <!-- Evaluates to true -->
[exists]
</arc:if>
```

## See Also

* [arc:exists](./op-arc-exists): Check that an attribute has a value in the specified item.
* [arc:equals](./op-arc-equals): Create a block that is executed when equality is met.
