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
Any: For any NULL input, the result is always TRUE, indicating a lenient approach to nullity.
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.
Does Not Exist: Opposite of Exists, returns FALSE for NULL inputs, with similar conditional behavior based on optionality.
Is Null: Directly checks if the input is NULL, returning TRUE if it is.
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
Empty/Not Empty: Checks if a string is empty or not. NULL is considered not empty (returns TRUE).
Equals/Not Equals: Assess equality with NULL. Interesting to note that NULL compared with NULL returns TRUE for Equals and FALSE for Not Equals.
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.
In/Not In: Used to check membership in a set. NULL shows consistent results, similar to string comparison logic.
Numeric Type Operations
Is Even/Is Odd: NULL is not considered for parity checks, returning FALSE.
Between/Not Between: NULL is not considered within any range, returning FALSE.
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]:
Last updated