Contact Us 1-800-596-4880

Get Array Count

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.