---
title: Formula endsWith – Check a Text Suffix in Nodinite Search Field Expressions
description: The endsWith function in the Nodinite Formula plugin returns true when the content ends with the expression. Syntax, parameters, and tested examples for message body, message context, and nested formulas.
---

# :fa-function: Formula - endswith

The `endsWith` function, one of the Logical functions in the [Formula][] plugin for [Search Field Expressions][], returns `true` when the content ends with the expression (suffix).

![Check the file extension of an Order-to-Cash event with endsWith on a message context value, animated walkthrough (7.12)][4]  
*Animated walkthrough: the Order Received event of order ORD-10005 in the [Order-to-Cash demo][] has the [context][Context] value `FileName` `ORD-10005-order-received-from-customer.json`. `endsWith('.json', context('FileName'))` returns `true`; `endsWith('.xml', context('FileName'))` gives "Processed with warning: The Expression yields no result": no value, not `false`.*  

## :fa-code: Syntax

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

### Parameters

| Parameter | Required | Description |
| --- | --- | --- |
| `'expression'` | ✅ Yes | The suffix to look for, in single quotes, for example `'T'`. |
| `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 ends with 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 matching value is enough, unless `matchAllValues` is `true`.
* The check is case-sensitive and follows the culture rules of the server, like [startsWith][].

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

## :fa-list-ol: Examples

### Example 1: Check the message body

#### Input

Message Body:

```text
GMT
```

#### Formula

```text
endsWith('T', body)
```

#### Result

```text
true
```

![Test Expression tab: endsWith('T', body) on the message body GMT returns true (7.12)][1]  
*The message body `GMT` ends with `T`, so `endsWith` returns `true`.*  

### Example 2: Check a message context value

#### Input

Message Context:

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

#### Formula

```text
endsWith('T', context('id'))
```

#### Result

```text
true
```

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

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

#### Input

Message Body:

```text
GMT UTC
```

#### Formula

```text
endsWith('C', regex('GMT|UTC', body))
```

#### Result

```text
true
```

![Test Expression tab: endsWith('C', regex('GMT|UTC', body)) on the message body GMT UTC returns true (7.12)][3]  
*[regex][] extracts `GMT` and `UTC`; `UTC` ends with `C`, and one match is enough, so `endsWith` returns `true`.*  

## :fa-hand-point-right: Next Steps

* :fa-magnifying-glass-plus: [Add or manage Search Field][]  
* :fa-flask: [Test Your Expression][]  
* :fa-hard-drive: [Add or manage Log View][]  

## :fa-link-horizontal: Related Topics

* :fa-equals: [equal][]  
* :fa-not-equal: [notEqual][]  
* :fa-circle-question: [isnull][]  
* :fa-arrow-right-to-bracket: [startsWith][]  
* :fa-function: [Formula][]  
* :fa-scroll: [Formula language rules][]  
* :fa-puzzle-piece: [Search Field Expressions][]  

[1]:{ndm}/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Logical/endswith_bodyAsContent.png
[2]:{ndm}/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Logical/endswith_messageContextAsContent.png
[3]:{ndm}/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Logical/endswith_FormulaFunctionAsContent.png
[4]:{ndm}/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Logical/Formula_EndsWith.gif

[Add or manage Log View]:{ndr}/Administration/1.%20Log%20Management/1.%20Log%20Views/Features/Add%20or%20Manage%20Log%20View.md
[Add or manage Search Field]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Add%20or%20manage%20Search%20Field.md
[body]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Source/body.md
[Context]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Source/context.md
[equal]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Logical/equal.md
[Formula]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Overview.md
[Formula language rules]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Overview.md#fa-scroll-formula-language-rules
[isnull]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Logical/isnull.md
[notEqual]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Logical/notEqual.md
[Order-to-Cash demo]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/Generate-O2C-Demo-Data.md
[regex]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Extract/regex.md
[Search Field]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/What%20is%20a%20Search%20Field.md
[Search Field Expressions]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Overview.md
[startsWith]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Logical/startsWith.md
[Test Your Expression]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Add%20or%20manage%20Search%20Field.md#test-your-expression