Default if null
Description
Returns the value when it is not null, and the fallback otherwise. Generic on both pins, in shape as well as type: scalars, arrays, maps and whole model values can be connected as long as both pins agree, and the type is fixed at design-time when the first one is. Pure function — the fallback is always evaluated.
When to use
Use Default if null to substitute a stand-in for an absent value, so the rest of the
pipeline can carry on without a branch — the no-code equivalent of a coalesce. It pairs
naturally with Break: optional model fields arrive as null when the payload omits them,
and a single Default if null turns them into something safe to log, concatenate, or send
onward. Only a null is replaced: an empty string, a zero and a false all pass through.
Whole collections work the same way, which is often the reason to reach for it: a payload
that sends "items": null becomes an empty array before anything downstream reads it.
When you need to act differently on missing data rather than paper over it, use
Is null? with Branch instead.
Pins
Input pins
| Pin | Type | Default | Notes |
|---|---|---|---|
| Value | generic | — | The value to pass through when it is present. The type resolves at design-time from the connected source, and fixes the type of the Fallback pin too — as does the shape, so an array Value needs an array Fallback. |
| Fallback | generic | — | Returned when Value is null. Usually a literal typed straight into the pin; it takes the same type Value resolved to. Left unconnected on an array or map pin it falls back to an empty collection, so the Result is still never null. |
Output pins
| Pin | Type | Notes |
|---|---|---|
| Result | generic | Value when it is not null, Fallback otherwise. Both share the resolved generic type and shape. |
Example
Give a missing quantity a sensible default. Parse an inbound order with Parse to model
and wire the Value output into Break. Wire Break’s optional quantity output into the
Value input of Default if null and type 1 into the Fallback input — the literal picks
up the integer type from the connected field. The Result output is always a usable
number, ready to wire into Multiply.