Skip to main content

isTypeString

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

To convert a non-string value to a string, use the asString function.

Parameters

  • VALUE (any)

    The value to test.

Examples

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

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

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

ATL in Text

Result

Notes

[[isTypeString(WholeJSON.data.year)]]

true

The test value is a string.

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

true

The test value is a string.

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

false

The test value is a JSON array.

[[isTypeString(WholeJSON.data.branches[0])]]

false

The test value is a null.

[[isTypeString(WholeJSON.data.branches[1])]]

true

The test value is a string.

[[isTypeString(WholeJSON.data.branches[2])]]

true

The test value is an empty string - although it has no characters, it is still a string.

[[isTypeString(WholeJSON.data.target)]]

false

The test value is a number.

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

false

The test value is a Boolean.