CxScript Types - nil
Updated over a week ago

No matter of which type a variable is, if there is no value to represent the variable contains the special value nil. So, if for instance the phone number of a candidate is unknown the value of the variable representing this phone number contains the value nil

If you would use a variable that contains the value nil, the result would be minimal or sometimes lead to an error message. For instance, if you would print a variable that contains the value nil nothing wil print. 

Even if you would reference a variable that does not exist the system wil use a value nil

Example

Suppose a variable abc does not exist (a variable is created by the cx:let element). Still a reference to this non-existing variable is used, for instance like:

<cx:write value="$abc"/>

The value of the reference to this non-exitsing variable is set on nil by the system. In this example this would not result in an error message, simply nothing is written. 

Remarks

  • If one key in a key-path contains the value nil, than the value of the whole key-path is nil.

  • The term nil is a keyword that kan be used in a condition.
    The following snippet contains an example of such use: "activity.toEmployee.phoneNumber = nil".

Did this answer your question?