---
schema_version: "1"
id: a0bfdd28060624f9ca6f33a29f2ce242268b8dac1e73849c2f5717f6bd887245
title: Get Array Count
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/rpa-builder/latest/toolbox-variable-handling-get-array-count.md
canonical_url: https://docs.mulesoft.com/rpa-builder/latest/toolbox-variable-handling-get-array-count
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 96d47da2c7aea60f65e29cd0b607711fa497427ce0e1a5b855f1850668cd0a29
description: MuleSoft Documentation Site
release: "6.7"
latest: true
---
---
product: RPA Builder
version: 6.7
is-latest-version: true
---

# Get Array Count

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

The _Get Array Count_ action step returns the number of elements in an array.

You can then use this number as the number of iterations in a loop (_Loop_), for example, across the
array elements.

## Properties

This action step contains no special properties other than the _general_ ones.

## Inbound Variables

- **Array to get count of** (array, default: blank) Array for which the number of elements is to be
  determined.

This array must be created beforehand using the _Workflow Based Variables_ element or any action
step that creates or returns an array.

The return array from the _Read from Excel File_ Action Step is shown only within the same
transaction as a Pin Variable. To use the _Array Count_ in a later transaction, copy the return
array into an array created beforehand in the Workflow Based Variables (see _Set\_Array\_Variable_).

## Outbound Variables

- **Array Count** (integer, default 0) Number of elements in the array

## Wizard

All arrays that are available within the Workflow are shown in the drop-down list next to _Array to
get count of_.

Ensure the array is correctly populated. An empty array returns an _Array Count_ of 0.

## Example

In this example, an auto repair shop wants to monitor automatically which _Services_ have been
performed on a certain vehicle.

These services are read from an array and checked off on a checklist.

To test the Workflow, the _Workflow Based Variables_ are

populated with sample values. In productive operation these values are then overwritten with values
from the _Car Service App_.

The _Services_ array is populated with all the services from the _Car Service App_ which are
performed.

First, in the transaction _130 Process list of done services_, the number of services that have been
performed is calculated using the _Get Array Count_ action step before each service is read in a
loop and graphically (see _OCR_) compared against the services on a checklist.

If the service is on the checklist, it will be checked off. The checklist is used later on in the
Workflow to calculate costs.

The configuration values of the individual action steps are passed on using (Pin) _Variables_.

## See Also

- [Read from Array](https://docs.mulesoft.com/rpa-builder/latest/toolbox-variable-handling-read-from-array)

- [Set Array Variable](https://docs.mulesoft.com/rpa-builder/latest/toolbox-variable-handling-set-array-variable)
