Empty()

Tests to see if a variable has a value. If the variable has a value, the function returns false. If the variable is an empty string or null, the function returns true.

The Empty() function has one parameter:

  • variable (string): Required. The variable that you want to test to see if it’s empty.

You can combine the Empty() function combined with If statements or the Iif() function to test for empty or null values, and to output the values of variables that aren't empty. This example declares three variables, assigns a text string to one, an empty string to another, and leaves the third unset.

The example produces this output.