IsEmpty Function
Using IsEmpty
to Check Property Values
The IsEmpty
function checks if a property value is empty. It's typically used in combination with IF
statements to make decisions based on the presence or absence of property values.
Example
Suppose you have a property of type code,
and you want to automatically set its value to "yes" or "no" based on whether two other properties are the same. Here's how you can do it using IsEmpty
and IF
statements:
=IF( IsEmpty(getproperty("requesting_department")); "no"; IF( IsEmpty(getproperty("benefitting_department")); "no"; IF( getproperty("requesting_department") = getproperty("benefitting_department"); "yes"; "no" ) ) )
Summary
The expression checks the following in order:
If the "requesting_department" is empty:
If true, it returns "no".
If the "benefitting_department" is empty (when "requesting_department" is not empty):
If true, it returns "no".
If both "requesting_department" and "benefitting_department" are not empty, it checks if they are equal:
If they are equal, it returns "yes".
If they are not equal, it returns "no".
This nested structure ensures that the final output is determined by a series of checks on the two properties.
Key Points
Info:
IsEmpty
is useful for validating the presence of data in properties.Success: The expression can accurately determine the relationship between two properties and return a corresponding value.
Warning: Ensure property codes are correctly referenced to avoid errors.
Error: If property codes are incorrect or if there is a syntax error, the expression will not execute as expected.
Following these steps, you can create a reliable expression that dynamically sets a property value based on the conditions you define.