Dit artikel is niet beschikbaar in het Dutch, weergeven in het English
not_null
TABLE OF CONTENTS
Find first argument that is not null
Definition
any not_null(any *$argument [, any $...])
Returns the first argument that does not resolve to null. Accepts one or more arguments, and will evaluate them in order until a non-null argument is encountered. If all arguments' values resolve to null, then a value of null is returned.
Parameters
any *$argument
One or more arguments of any type, separated by comma.
Returns
any
The first argument provided that does not resolve to null.
Examples
Sample data
{
"null1": null,
"null2": null,
"empty_array": [],
"text": "alpha"
}Transformation
{
a: not_null(nonexistent, null1, null2, empty_array, text),
b: not_null(null1, null2, `null`, text, empty_array),
c: not_null(null1, null2)
}Result
{
"a": [],
"b": "alpha",
"c": null
}Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article