isEmpty
Tests if a string, list, table cell, or JSON object is empty.
The function returns a Boolean true (empty) or false (not empty).
The function returns a Boolean true for null values.
This function is typically used in conditional statements — see here for an example.
Parameters
- INPUT (string, list, cell, or JSON object) - The element to test. Can be a string, list, cell or JSON object. 
Examples
Testing strings with isEmpty
| ATL in Script | Result | Notes | 
|---|---|---|
| 
 | true | The string is empty. | 
| 
 | false | The string includes a text entry. | 
Testing lists with isEmpty
| ATL in Script | Result | Notes | 
|---|---|---|
| 
 | true | The list is empty. | 
| 
 | false | The list contains numbers. | 
Testing JSON objects with isEmpty
Assume a "Describe a JSON Object" project with this data:
 {
    "results": [
        {
            "name": "Peter",
            "score": 67
        },
        {
            "name": "Paul",
            "score": ""
        },
        {
            "name": "Mary",
            "score": null
        }
    ]
}The "results" array contains three JSON objects. Each object contains two key–value pairs.
| ATL in Script | Result | Notes | 
|---|---|---|
| 
 | false | The object contains a value. | 
| 
 | true | The object contains an empty string. | 
| 
 | true | The object contains a null value. | 
Note
With JSON data, a null value is indicated by a null literal — see the example data above.
Testing table cells with isEmpty
Assume a "Describe Row in Context" project with this data:
| 
 | Name | Score | 
|---|---|---|
| Row 1 | Peter | 67 | 
| Row 2 | Mary | 
These examples test whether there is a value in the Score column for the focus row:
| ATL in Script | Result (Row 1) | Notes | 
|---|---|---|
| 
 | false | The Row 1 cell contains a value. | 
| ATL in Script | Result (Row 2) | Notes | 
|---|---|---|
| 
 | true | The Row 2 cell is empty. | 
Using isEmpty in a conditional statement
Again, assume a "Describe Row in Context" project with this data:
| Name | Score | |
|---|---|---|
| Row 1 | Peter | 67 | 
| Row 2 | Mary | 
You might write a conditional statement to cover the possibility of a missing Score value. For example:
[[if(isEmpty(Score)){[[FocusRowName]]'s score is unknown.}else{[[FocusRowName]] scored [[Score]].}]]The conditional statement ensures appropriate narrative text is returned.
| Row 1 Result | Row 2 Result | 
|---|---|
| Peter scored 67. | Mary's score is unknown. |