If one of the data types (Text, Numeric, Currency, Date, or DateTime) hasn’t been assigned a value, it is considered to be null. The only exception is in the Text data type, where you can assign a value of “null” (string Text = null), which is different from an empty string with no assigned value.
Note: the following tests are usually used as the test argument in an If -Then -Else function described in the previous section. When used by itself, the test must be set to the appropriate formula type and will return either “true or “false”.
Null Test for Text –These formulas test a string of text for the specified condition. Returns either “True” or “False”.
Test for null
Returns true if the string is a "null" string
Test for empty
Returns true if the string is empty (no assigned value)
In this application, we consider a Text data type to be null if it is in any of these three states: it has a value of “null”, is empty (no assigned value), or consists exclusively of white-space characters. Therefore, we’ll be using the following formula as the Null Test for Text:
Test for null, empty, or white-space
Returns true if the string is either null, empty, or consists exclusively of white- space characters.
Null Test for Numeric Values
If a numeric value has been declared, but hasn’t been assigned a value, it will be automatically assigned a default value of 0. But in certain cases where a null value is possible, the same method that was used for text should be used (IsNullOrWhiteSpace) to test for null. This formula will first convert the numeric value to a string ([num1].ToString()), and then use the null test method: (IsNullOrWhiteSpace):
Test for null
Returns true if the numeric value hasn’t
been assigned a value.
If a number has a value of null, and is used in a formula, it will generate an error. The following formula will convert a null value to zero, so it can be used in the formula. If the number isn’t null, the same number is returned:
Null Test for Dates – If a Field Type set to “Date” isn’t set to a value, it will be stored as a null date in the database as 00-00-0001. Therefore, if the date string contains “001”, it is considered null.
If([date_of_response]].ToString(). Contains("001"), "Closed","Open")
Returns “Closed” if the given date is null. Otherwise “Open” is returned.
Must be set as Formula–Text.
If a date has a value of null, and is used in a date method it will generate an error.
Null Test for Documents – If a Field Type is set to “File Attachment”, this formula can be used to determine if a file is attached or not:
Returns “Empty” if a file hasn’t been uploaded yet for Doc1. Otherwise “Uploaded” is returned. Must be set as Formula–Text.
Note that there are no formulas for documents other than a null test.