---
title: Formula equal – Check Value Equality in Nodinite Search Field Expressions
description: The equal function in the Nodinite Formula plugin returns true when the content equals the expression. Syntax, parameters, and tested examples for message body, message context, and nested formulas.
---

# <i class="fal fa-function" aria-hidden="true"></i> Formula - equal

The `equal` function, one of the Logical functions in the [Formula][] plugin for [Search Field Expressions][], returns `true` when the content equals the expression.

![Compare the order currency with equal, with a match, a mismatch, and a different case, animated walkthrough (7.12)][ex6]  
*Animated walkthrough: on the JSON Order Received event of order ORD-10005 in the [Order-to-Cash demo][], `equal('USD', jsonPath('$.currency', body))` returns `true`. With `'SEK'` there is no value, not `false`, and with `'usd'` there is no value either, because the comparison is case-sensitive.*  

## <i class="fal fa-code" aria-hidden="true"></i> Syntax

```text
equal('expression', content [, content ...] [, matchAllValues])
```

### Parameters

| Parameter | Required | Description |
| --- | --- | --- |
| `'expression'` | ✅ Yes | The text to compare with, in single quotes, for example `'GMT'`. |
| `content` | ✅ Yes | The value or values to check: [body][], [context][Context], or another Formula function such as [regex][]. When you give several content arguments, each of them must match. |
| `matchAllValues` | ❌ No | Unquoted `true` or `false` (default). Applies when one content argument returns several values: `false` means at least one value must match, `true` means every value must match. A quoted `'true'` is not the flag; it is compared as text. |

### Returns

* `true` when the content equals the expression.
* When it doesn't, there is no value: Test Expression shows *Processed with warning: The Expression yields no result*.
* The comparison is case-sensitive: `equal('gmt', body)` on the body `GMT` returns no value. This differs from [regex][], which ignores case.
* When one content argument returns several values, one matching value is enough, unless `matchAllValues` is `true`.

Quoting, nesting, and how `content` is resolved are described in the [Formula language rules][].

## <i class="fal fa-list-ol" aria-hidden="true"></i> Examples

### Example 1: Check the message body

#### Input

Message Body:

```text
GMT
```

#### Formula

```text
equal('GMT', body)
```

#### Result

```text
true
```

![Test Expression with equal('GMT',body) on the message body GMT, returning true (7.12)][23]  
*The message body is exactly `GMT`, so `equal` returns `true`.*  

### Example 2: Check a message context value

#### Input

Message Context:

| Key | Value |
| --- | --- |
| `id` | `GMT` |

#### Formula

```text
equal('GMT', context('id'))
```

#### Result

```text
true
```

![Test Expression with equal('GMT',context('id')) on the context key id with value GMT, returning true (7.12)][25]  
*The context value of `id` is `GMT`, so `equal` returns `true`.*  

### Example 3: Check values extracted by another function

#### Input

Message Body:

```text
GMT UTC
```

#### Formula

```text
equal('UTC', regex('GMT|UTC', body))
```

#### Result

```text
true
```

![Test Expression with equal('UTC',regex('GMT|UTC',body)) on the message body GMT UTC, returning true (7.12)][24]  
*[regex][] extracts `GMT` and `UTC`; one of them equals `UTC`, so `equal` returns `true`.*  

### Example 4: Check several message context values

#### Input

Message Context:

| Key | Value |
| --- | --- |
| `id` | `GMT` |
| `id2` | `UTC` |

#### Formula

```text
equal('UTC', context(regex('id.*')))
```

#### Result

```text
true
```

![Test Expression with equal('UTC',context(regex('id.*'))) on the context keys id and id2, returning true (7.12)][26]  
*`context(regex('id.*'))` returns the values of both keys, `GMT` and `UTC`; one of them equals `UTC`, so `equal` returns `true`.*  

### Example 5: Require every extracted value to match

#### Input

Message Body:

```xml
<Items>
  <Item>Hello World</Item>
  <Item>Hello World</Item>
</Items>
```

#### Formula

```text
equal('Hello World', xPath('Items/Item', body), true)
```

#### Result

```text
true
```

The unquoted `true` is `matchAllValues`: every `Item` must equal `Hello World`. If one `Item` held another text, the formula would return no value, while the same formula without `true` would still return `true`.

![Test Expression tab: equal('Hello World', xPath('Items/Item', body), true) on two Hello World items returns true (7.12)][ex5]  
*Both `Item` values equal `Hello World`, so the check passes even when every value must match.*  

## <i class="fal fa-hand-point-right" aria-hidden="true"></i> Next Steps

* <i class="fal fa-magnifying-glass-plus" aria-hidden="true"></i> [Add or manage Search Field][]  
* <i class="fal fa-flask" aria-hidden="true"></i> [Test Your Expression][]  
* <i class="fal fa-hard-drive" aria-hidden="true"></i> [Add or manage Log View][]  

## <i class="fal fa-link-horizontal" aria-hidden="true"></i> Related Topics

* <i class="fal fa-not-equal" aria-hidden="true"></i> [notEqual][]  
* <i class="fal fa-circle-question" aria-hidden="true"></i> [isnull][]  
* <i class="fal fa-arrow-right-to-bracket" aria-hidden="true"></i> [startsWith][]  
* <i class="fal fa-arrow-right-from-bracket" aria-hidden="true"></i> [endsWith][]  
* <i class="fal fa-function" aria-hidden="true"></i> [Formula][]  
* <i class="fal fa-scroll" aria-hidden="true"></i> [Formula language rules][]  
* <i class="fal fa-puzzle-piece" aria-hidden="true"></i> [Search Field Expressions][]  

[23]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Logical/equal_simpleParameter_body.png
[24]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Logical/equal_nested_body.png
[25]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Logical/equal_simpleParameter_messageContext.png
[26]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Logical/equal_nested_messageContext.png

[Add or manage Log View]:https://docs.nodinite.com/administration/log-management/log-views/features/add-or-manage-log-view/
[Add or manage Search Field]:https://docs.nodinite.com/administration/log-management/search-fields/features/add-or-manage-search-field/
[body]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/source/body/
[Context]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/source/context/
[endsWith]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/logical/endswith/
[ex5]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Logical/equal_Example5.png
[ex6]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Logical/Formula_Equal.gif
[Formula]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/overview/
[Formula language rules]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/overview/#fa-scroll-formula-language-rules
[isnull]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/logical/isnull/
[notEqual]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/logical/notequal/
[Order-to-Cash demo]:https://docs.nodinite.com/repository-model/bpms/examples/order-to-cash/generate-o2c-demo-data/
[regex]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/extract/regex/
[Search Field Expressions]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/overview/
[startsWith]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/logical/startswith/
[Test Your Expression]:https://docs.nodinite.com/administration/log-management/search-fields/features/add-or-manage-search-field/#test-your-expression