Example in the photo… When preparing a node with data sometimes I do not have that data available.
And instead of loading an empty field into the node, my expression will load null and pass a null object to the receiving API.
Is it possible to stop the node from sending null objects?
What is the error behavior?
The receiving service had valid data for said record, but because a null object was passed that valid data is nulled out.
In your example it should still resolve to undefined if both variables resolve to null or undefined. If any of them resolves to something else it will use that one.
@jan By experimentation from what I can tell…
for strings {{ $json.name || undefined}} = $json.name
for integers {{undefined || $json.number }} = $json.number
for bools {{undefined || $json.bool }} = $json.bool
Hmmm maybe this is more accurately a situation where if a value is undefined then
{{undefined || “default value”}} is invalid undefined takes the priority.
No I keep testing and cannot find a solid pattern. Or the pattern I find is non functional.
I think this might be a bug.
That makes it impossible or very difficult to reliably set default values.