NULL Value Handling/Behavior

Nected has a comprehensive approach for handling NULL values and undefined (missing key) scenarios across different data types and operations. This approach is crucial for ensuring accurate data processing, error handling, and maintaining data integrity in various applications within Nected. Here's a detailed breakdown:

Generic Type Operations

  1. Any: For any NULL input, the result is always TRUE, indicating a lenient approach to nullity.

  2. Exists: Returns TRUE for NULL inputs. However, if a key is marked as optional, the behavior changes, potentially leading to errors if the optionality is not correctly handled.

  3. Does Not Exist: Opposite of Exists, returns FALSE for NULL inputs, with similar conditional behavior based on optionality.

  4. Is Null: Directly checks if the input is NULL, returning TRUE if it is.

  5. Not Null: Checks if the input is not NULL, returning FALSE for NULL inputs.

Boolean Type Operations

Is True/Is False: NULL is considered neither true nor false, so both return FALSE.

String Type Operations

  1. Empty/Not Empty: Checks if a string is empty or not. NULL is considered not empty (returns TRUE).

  2. Equals/Not Equals: Assess equality with NULL. Interesting to note that NULL compared with NULL returns TRUE for Equals and FALSE for Not Equals.

  3. Contains/Does Not Contain, Starts With/Does Not Start With, Ends With/Does Not End With: These operations check for substrings within a main string. NULL behaves consistently, with FALSE for direct comparison with non-NULL and TRUE when both sides are NULL.

  4. In/Not In: Used to check membership in a set. NULL shows consistent results, similar to string comparison logic.

Numeric Type Operations

  1. Is Even/Is Odd: NULL is not considered for parity checks, returning FALSE.

  2. Between/Not Between: NULL is not considered within any range, returning FALSE.

  3. Equals/Not Equals, Greater Than/Less Than and Variants: Follow similar logic to string comparisons. Special attention to "Greater than or equals" and "Less than or equals" which return TRUE when both sides are NULL.

Date/DateTime Type Operations

Mirrors the logic of numeric operations, adapted for date/time comparisons.

Handling Undefined (Missing Key) Scenarios

In cases where a key is marked as optional, the behavior of these operations might change. Particularly for operators like "Exists" and "Does Not Exist", the optional nature of a key can lead to different outcomes or errors.

Implications in Custom JavaScript Formulas and Actions

  • When using these operators in custom JavaScript formulas or as tokens in actions, it's crucial to anticipate these behaviors. For instance, understanding how NULL is treated in comparisons can prevent logical errors in custom scripts.

  • Best practices would involve explicit checks for NULL or undefined values to avoid unintended results.

Troubleshooting and Expected Errors

Incorrect handling of NULL or undefined values can lead to various issues, from incorrect data processing to application errors. The dataset provides a basis for predicting and troubleshooting these issues.

In summary, this dataset from Nected provides a detailed blueprint of how NULL and undefined values are handled across different data types and operations. It is an essential guide for developers and users in Nected's environment, aiding in error prevention, data validation, and ensuring logical consistency in operations involving NULL or missing values.

NULL handling in Nected:

Here’s how null values are handled in a specific context, in Nected [In-case of Nullable=True]:

TypeOperatorLHS(Input)RHS(Compared with)RHS2ResultSpecific Cases

Generic

Any

NULL

TRUE

Exists

NULL

TRUE

In-case of Optional=True,In-case of Optional=False this will through error

Does Not Exists

NULL

FALSE

In-case of Optional=TrueIn-case of Optional=False this will through error

Is Null

NULL

TRUE

Not Null

NULL

FALSE

Boolean

Is True

NULL

FALSE

Is False

NULL

FALSE

string

Empty

NULL

FALSE

Not Empty

NULL

TRUE

Equals

NULL

Not NULL

FALSE

Not Null

NULL

FALSE

NULL

NULL

TRUE

Not Equals

NULL

Not NULL

TRUE

Not Null

NULL

TRUE

NULL

NULL

FALSE

Contains

NULL

Not NULL

FALSE

Not Null

NULL

FALSE

NULL

NULL

TRUE

Does Not Contains

NULL

Not NULL

TRUE

Not Null

NULL

TRUE

NULL

NULL

FALSE

Starts With

NULL

Not NULL

FALSE

Not Null

NULL

FALSE

NULL

NULL

TRUE

Does Not Starts With

NULL

Not NULL

TRUE

Not Null

NULL

TRUE

NULL

NULL

FALSE

Ends With

NULL

Not NULL

FALSE

Not Null

NULL

FALSE

NULL

NULL

TRUE

Does Not Ends With

NULL

Not NULL

TRUE

Not Null

NULL

TRUE

NULL

NULL

FALSE

In

NULL

Not NULL

FALSE

Not Null

NULL

FALSE

NULL

NULL

TRUE

Not In

NULL

Not NULL

TRUE

Not Null

NULL

TRUE

NULL

NULL

FALSE

numeric

Is Even

NULL

FALSE

Is Odd

NULL

FALSE

Between

NULL

Anything

FALSE

Not Between

NULL

Anything

Equals

NULL

Not NULL

FALSE

Not Null

NULL

FALSE

NULL

NULL

TRUE

Not Equals

NULL

Not NULL

TRUE

Not Null

NULL

TRUE

NULL

NULL

FALSE

Greater than

NULL

Not NULL

FALSE

Not Null

NULL

FALSE

NULL

NULL

FALSE

Less than

NULL

Not NULL

FALSE

Not Null

NULL

FALSE

NULL

NULL

FALSE

Greater than or equals

NULL

Not NULL

FALSE

Not Null

NULL

FALSE

NULL

NULL

TRUE

Less than or equals

NULL

Not NULL

FALSE

Not Null

NULL

FALSE

NULL

NULL

TRUE

Date/ DateTime

Between

NULL

Anything

FALSE

Not Between

NULL

Anything

Equals

NULL

Not NULL

FALSE

Not Null

NULL

FALSE

NULL

NULL

TRUE

Not Equals

NULL

Not NULL

TRUE

Not Null

NULL

TRUE

NULL

NULL

FALSE

Greater than

NULL

Not NULL

FALSE

Not Null

NULL

FALSE

NULL

NULL

FALSE

Less than

NULL

Not NULL

FALSE

Not Null

NULL

FALSE

NULL

NULL

FALSE

Greater than or equals

NULL

Not NULL

FALSE

Not Null

NULL

FALSE

NULL

NULL

TRUE

Less than or equals

NULL

Not NULL

FALSE

Not Null

NULL

FALSE

NULL

NULL

TRUE

List

Empty

Null

FALSE

Not Empty

Null

TRUE

IN

Not Null

Null

FALSE

Null

Not Null

FALSE

Null

Null

TRUE

Not In

Not Null

Null

TRUE

Null

Not Null

TRUE

Null

Null

FALSE

Contains

Null

Not Null

FALSE

Null

Null

TRUE

Not Null

Null

FALSE

Not Contains

Null

Not Null

TRUE

Null

Null

FALSE

Not Null

Null

TRUE

MatchAll

Null

Not Null

FALSE

Null

Null

TRUE

Not Null

Null

FALSE

Not MatchAll

Null

Not Null

TRUE

Null

Null

FALSE

Not Null

Null

TRUE

Equals

Null

Not Null

FALSE

Null

Null

TRUE

Not Null

Null

FALSE

Not Equals

Null

Not Null

TRUE

Null

Null

FALSE

Not Null

Null

TRUE

ContainsIn

Null

[]

FALSE

Null

[Null]

TRUE

Null

Null

TRUE

Not Null

Null

FALSE

Not ContainsIn

Null

[]

TRUE

Null

[Null]

FALSE

Null

Null

FALSE

Not Null

Null

TRUE

Last updated