Tags · Functions · Objects
Lucee Function Reference
Choose a function:

Function IIF

Evaluates a Boolean conditional dynamic expression. Depending
on whether the expression is true or false, dynamically
evaluates one of two string expressions and returns the result.

Example

iif(boolean condition,string string_expression1,string string_expression2):any

Arguments

The arguments for this function are set. You can not use other arguments except the following ones.
Name Type Required Description
condition boolean  Yes An expression that can be evaluated as a Boolean.  
string_expression1 string  Yes Expression to evaluate and return if condition is true.  
string_expression2 string  Yes Expression to evaluate and return if condition is false.