length() Function

Function

length( array )

This function returns the number of elements in an array.

See also:

  • isnull(): Use this function to determine if the process variable or array contains null values.
  • count(): Use this function to include null elements in the number of elements in a process variable or array.

Parameters

Keyword Type Description

array

Any Type Array

The array in which to calculate the number of elements.

Returns

Integer

Usage considerations

Null elements

This function does not count null elements.

For example, if used on a null result of a query from the Query Database Smart Service, the expression fails to evaluate and causes an error. To avoid an error, first check the result set for a null value using the isnull() function before attempting to count the result set using the length() function.

Examples

You can experiment with this function in the test box below.

Test Input

length({10, 20, 30}) returns 3

Open in Github Built: Fri, Dec 03, 2021 (02:38:47 PM)

On This Page

FEEDBACK