Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Current »

Function: ifNull()

Acts as a simple IF statement to determine what to do when the supplied expression is _NULL. It checks the value returned by the first expression, if this is _NULL the second expression will run, and if it is not _NULL the value in the initial expression is used. An optional third expression can be provided that will run if the first expression is not blank, instead of simply returning the non-null value.

Syntax

  1. ifNull(expression, nullReturnValue)
  2. ifNull(expression, nullReturnValue, notNullReturnValue)
ArgumentTypeDescription
expressionAnyThe expression to be evaluated and checked. If notNullReturnValue is not provided, then this is used as the return value if expression does not evaluate to _NULL.
nullReturnValueAnyThe value to be returned if expression is _NULL
notNullReturnValueAnyAn optional parameter containing the value to be returned if expression does not evaluate to _NULL.

Examples

ifNull( in.prodID, "failed", "success" )

Resolve the status of an order for which, if it has been successful, we expect to find a product ID on a target system. If in.prodID has a value, the order was successful. If in.prodID is _NULL, the order failed.


ifNull(calls.numCalls, 0)

Get the number of calls from an lookup Pipe. If there are no calls, calls.numCalls is _NULL so we assign the value 0. Otherwise, we simply want the original value of calls.numCalls.

See Also

  • No labels