isEmpty
Table of Contents
Overview
The isEmpty function takes an expression as argument. It returns true if the value resolved by the expression is empty. Otherwise, it returns false.
Note: Please refer to the differences between isBlank(), isNull() and isEmpty() and how data can be validated.
Return Type
- BOOLEAN
Syntax
<variable> = <expression>.isEmpty();
where,
Parameter | Data type | Description |
<variable> | BOOLEAN | Variable which will contain the returned boolean value. |
<expression> | TEXT/LIST/MAP/COLLECTION | Variable which will hold the expression awaiting the empty validation. |
Examples
listVar = {"Projects", "Mail", {"Zoho Creator", "Zoho CRM"}}; info listVar.isEmpty(); //returns false
collVar = Collection(); info collVar.isEmpty(); //returns true
mapVar = Map({"key1":"value1", "key2":"value2"}); mapVar = {}; info mapVar.isEmpty(); //returns true
textVar = " "; info textVar.isEmpty(); //returns false