---
title: Formula isnull – Default Values for Null or Empty Content in Nodinite Search Field Expressions
description: The isnull function in the Nodinite Formula plugin returns a default value when the content is null or empty, and the content itself otherwise. Syntax, parameters, and examples with jsonPath.
---

# :fa-function: Formula - isnull

:new6.1:

The `isnull` function, one of the Logical functions in the [Formula][] plugin for [Search Field Expressions][], returns a default value when the content is null or empty, and the content itself otherwise.

![Fall back to a default text when the customer phone number is missing with isnull, animated walkthrough (7.12)][ex3]  
*Animated walkthrough: the JSON Order Received event of order ORD-10005 in the [Order-to-Cash demo][] has no phone number, so [jsonPath][] alone gives "Processed with warning: The Expression yields no result". Wrapped in `isnull` with `'no phone given'`, the formula returns that text. On the e-mail address, which is there, the same formula returns the address itself.*  

## :fa-code: Syntax

```text
isnull(content, 'default')
```

### Parameters

| Parameter | Required | Description |
| --- | --- | --- |
| `content` | ✅ Yes | The value to check, typically the result of another Formula function such as [jsonPath][] or [xPath][xpath], or [body][] or [context][]. |
| `'default'` | ✅ Yes | The text to return when `content` is null or empty, in single quotes. |

### Returns

* The `'default'` text when `content` is null or empty, or gives no value at all, such as a [jsonPath][] to a property the message doesn't have.
* Otherwise the value of `content`, unchanged.

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

## :fa-list-ol: Examples

### Example 1: Return the default when the value is null

#### Input

Message Body:

```json
{ "name": null }
```

#### Formula

```text
isnull(jsonPath('name', body), 'default')
```

#### Result

```text
default
```

The `name` property is null, so `isnull` returns the default text.

![Test Expression tab: isnull(jsonPath('name', body), 'default') on a JSON body where name is null returns default (7.12)][ex1]  
*[jsonPath][] finds no value for the null property, so the fallback text is used.*  

### Example 2: Return the value when it is present

#### Input

Message Body:

```json
{ "name": "John Doe" }
```

#### Formula

```text
isnull(jsonPath('name', body), 'default')
```

#### Result

```text
John Doe
```

The `name` property has a value, so `isnull` returns it unchanged.

![Test Expression tab: the same isnull formula on a JSON body where name is John Doe returns John Doe (7.12)][ex2]  
*Same formula as Example 1; with a value present, the default text is not used.*  

## :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-arrow-right-to-bracket: [startsWith][]  
* :fa-arrow-right-from-bracket: [endsWith][]  
* :fa-function: [Formula][]  
* :fa-scroll: [Formula language rules][]  
* :fa-puzzle-piece: [Search Field Expressions][]  

[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
[endsWith]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Logical/endsWith.md
[equal]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Logical/equal.md
[ex1]:{ndm}/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Logical/isnull_Example1.png
[ex2]:{ndm}/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Logical/isnull_Example2.png
[ex3]:{ndm}/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Logical/Formula_IsNull.gif
[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
[jsonPath]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Extract/jsonPath.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
[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
[xpath]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Extract/xPath.md