---
title: "length · RUAL Documentation"
description: "Returns the total length of the given array."
canonical: https://docs.rual.nl/block-types/array/array_length
language: en
---

# length

This block is part of the [`array`](https://docs.rual.nl/block-types/array) group and was last modified in core [`v10.4.28`](https://docs.rual.nl/core-versions/100428).

Returns the total length of the given array.

- array required `array` The array for which to calculate the length.

- Length `number` The total length of the array.

Outputs the number of elements in the array on length. A missing or non-array input counts as 0. Nested arrays count as one element each; null elements are counted.

| `size` |
| --- |

[length](https://docs.rual.nl/block-types/array/array_length) takes an array and outputs its item count as a number. Here the array is built with [with values](https://docs.rual.nl/block-types/array/array_of_values), the count is compared against a fixed [number](https://docs.rual.nl/block-types/number/number_default) with [>](https://docs.rual.nl/block-types/condition/condition_gt), and the comparison drives a [branch](https://docs.rual.nl/block-types/flow/branch). The classic "do we have enough items" check.

![Studio canvas example for the length block: counting items before branching.](https://docs.rual.nl/canvas-examples/array_length.png)

### Commonly used with

In production blueprints, this block is most often wired together with:

- [===](https://docs.rual.nl/block-types/condition/condition_deep_equal): this block feeds into it. returns true if the two values are equal. Compares any type: numbers by value across int/float, strings and booleans strictly, objects and arrays deeply. There is no string/number coercion, so &quot;1&quot; does not equal 1.

- [remove duplicates](https://docs.rual.nl/block-types/array/array_remove_duplicates): feeds into this block. Removes duplicate values from an array.

- [find by key - value](https://docs.rual.nl/block-types/array/array_get_objects_by_field_value): feeds into this block. Returns the matching objects for the given key value pair.

- [get fields](https://docs.rual.nl/block-types/object/object_field_getter_multiple): feeds into this block. Gets the selected fields from the given object.

- [new object](https://docs.rual.nl/block-types/object/object_new_fields): this block feeds into it. Builds a new object filled with the given fields.

- [>=](https://docs.rual.nl/block-types/condition/condition_gte): this block feeds into it. returns true if the number is higher or equal.

### Version history

Introduced in [`v10.4.28`](https://docs.rual.nl/core-versions/100428).
