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.

Marketing Cloud Engagement ✅ Yes
Marketing Cloud Next ✅ Yes

This function became available in Marketing Cloud Next during the Summer ’26 release (API version 67.0).

In Marketing Cloud Engagement, the variable parameter can be a variable, a string literal, or a number. In Marketing Cloud Next, the variable parameter must refer to a variable. If it isn’t a variable, the function returns an error.

The Empty() function has this 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.