---
title: Formula notEqual – Check Value Inequality in Nodinite Search Field Expressions
description: The notEqual function in the Nodinite Formula plugin returns true when the content differs from 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 - notequal

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

![Check that an order is not in a given currency with notEqual on an Order-to-Cash event, animated walkthrough (7.12)][4]  
*Animated walkthrough: on the JSON Order Received event of order ORD-10005 in the [Order-to-Cash demo][], `notEqual('SEK', jsonPath('$.currency', body))` returns `true`, because the order is in USD. `notEqual('USD', jsonPath('$.currency', body))` gives "Processed with warning: The Expression yields no result": equal values give no value, not `false`.*  

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

```text
notEqual('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][] or [jsonPath][]. When you give several content arguments, each of them must differ. |
| `matchAllValues` | ❌ No | Unquoted `true` or `false` (default). Applies when one content argument returns several values: `false` means at least one value must differ, `true` means every value must differ. A quoted `'true'` is not the flag; it is compared as text. |

### Returns

* `true` when the content differs from the expression.
* When it doesn't, there is no value, not `false`: Test Expression shows *Processed with warning: The Expression yields no result*, and the [Search Field][] gets no value.
* When one content argument returns several values, one value that differs is enough, unless `matchAllValues` is `true`. For example, `notEqual('GMT', regex('GMT|UTC', body))` on `GMT UTC` returns `true`, because `UTC` differs.

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
UTC
```

#### Formula

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

#### Result

```text
true
```

![Test Expression tab: notEqual('GMT', body) on the message body UTC returns true (7.12)][1]  
*The message body `UTC` differs from `GMT`, so `notEqual` returns `true`.*  

### Example 2: Check a message context value

#### Input

Message Context:

| Key | Value |
| --- | --- |
| `id` | `UTC` |

#### Formula

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

#### Result

```text
true
```

![Test Expression tab: notEqual('GMT', context('id')) with the context key id set to UTC returns true (7.12)][2]  
*The context value of `id` is `UTC`, which differs from `GMT`, so `notEqual` returns `true`.*  

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

#### Input

Message Body:

```text
GMT UTC
```

#### Formula

```text
notEqual('CET', regex('GMT|UTC', body))
```

#### Result

```text
true
```

![Test Expression tab: notEqual('CET', regex('GMT|UTC', body)) on the message body GMT UTC returns true (7.12)][3]  
*[regex][] extracts `GMT` and `UTC`; neither is `CET`, so `notEqual` returns `true`.*  

## <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-equals" aria-hidden="true"></i> [equal][]  
* <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][]  

[1]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Logical/notequla_BodyAsContent.png
[2]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Logical/notequal_MessageContextAsContent.png
[3]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Logical/notequal_FormulaFunction.png
[4]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Logical/Formula_NotEqual.gif

[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/
[equal]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/logical/equal/
[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/
[jsonPath]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/extract/jsonpath/
[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]:https://docs.nodinite.com/administration/log-management/search-fields/features/what-is-a-search-field/
[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