Skip to content
Documentation
Updated 2 minutes to read
Markdown

New 6.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)
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.

isnull(content, 'default')
Parameter Required Description
content ✅ Yes The value to check, typically the result of another Formula function such as jsonPath or xPath, or body or context.
'default' ✅ Yes The text to return when content is null or empty, in single quotes.
  • 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.

Example 1: Return the default when the value is null

Section titled “Example 1: Return the default when the value is null”

Message Body:

{ "name": null }
isnull(jsonPath('name', body), 'default')
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)
jsonPath finds no value for the null property, so the fallback text is used.

Example 2: Return the value when it is present

Section titled “Example 2: Return the value when it is present”

Message Body:

{ "name": "John Doe" }
isnull(jsonPath('name', body), 'default')
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)
Same formula as Example 1; with a value present, the default text is not used.

...

Version:
Release date: N/A
Loading...

Explore Nodinite for 30 days – completely free

  • Find out why this is the leading O&M software
  • Prove your business case
  • Test the self-service for the business side

Loading...

See how Nodinite resolves your technical issues, in a LIVE Demo!

Once you submit this request:

  • We will give you a short call to understand the issues you want to tackle.
  • Understand solutions you have tried and why were you not happy with them.
  • Book a convenient slot for a LIVE demo!

Loading...