Skip to content

source.isJSONNull

Use when: You want to read values from the original incoming message before any mapping changes. If you need the modified message during mapping, use message.isJSONNull.

Signature: source.isJSONNull(nodePath)

Returns: Boolean matched - true if the given JSON nodePath is a null value node

Find the first node that matches nodePath and evaluates if it is a null value or not.

Note

This method only applies to JSON-formatted messages.

Parameters

Type Name Description Default
String nodePath the node path (XPath, HPath, Column ID, etc.)

Example

// Given a JSON source with a null-valued "age" node.
/* source:
{
    "name": "David",
    "age": null
}
*/

// Evaluate whether the node at nodePath is a JSON null value.
if (source.isJSONNull('/age')) {
    // The age node was sent as an explicit null rather than omitted.
}