---
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.
---

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

<sup><span class="nodinite-new-badge">New 6.1</span></sup>

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.*  

## <i class="fal fa-code" aria-hidden="true"></i> 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][].

## <i class="fal fa-list-ol" aria-hidden="true"></i> 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.*  

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

[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/
[ex1]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Logical/isnull_Example1.png
[ex2]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Logical/isnull_Example2.png
[ex3]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Logical/Formula_IsNull.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
[jsonPath]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/extract/jsonpath/
[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/
[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
[xpath]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/extract/xpath/