Skip to main content

isTypeList

Tests if the data type of the input value is a list and returns a Boolean true or false.

To make a list from zero or more input values, use makeList. To convert a non-list value (e.g. a column or a JSON array) to a list, use asList instead.

Parameters

  • VALUE (any)

    The value to test.

Examples

Testing lists with isTypeList

Here's how you might use isTypeList to check if a value or variable is a list.

ATL in Script

Result

Notes

[[isTypeList( ("USA", "Canada", "UK") )]]

true

The test value is a list.

[[isTypeList( ("null") )]]

false

The test value is null.

[[isTypeList(makeList(1, 2, 3))]]

true

The test value is a list.

[[isTypeList(makeList())]]

true

The test value is an empty list.

Testing JSON data with isTypeList

Assume a "Describe a JSON Object" project with this data:

{
   "data": {
      "mnth": "January",
      "year": "2023",
      "state": "California",
      "branches": [
         "null",
         "San Francisco",
         ""
      ],
      "sales": 245678.89,
      "target": 250000,
      "manager": {
         "name": "Robyn Banks",
         "age": 51, 
         "married": false
      }
   }
}

Here's how you might use isTypeList to check values in the data:

ATL in Text

Result

Notes

[[isTypeList(WholeJSON.data.state)]]

false

The test value is a string.

[[isTypeList(WholeJSON.data.branches)]]

false

The test value is a JSON array.

[[isTypeList(asList(WholeJSON.data.branches))]]

true

The JSON array has first been converted to a list using the asList function.

[[isTypeList(makeList(WholeJSON.data.manager.age))]]

true

The test value is a list.

[[isTypeList(WholeJSON.data.manager.married)]]

false

The test value is a Boolean.