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.

An array is either created via the element Workflow Based Variables or returned as the result of the Read from Excel File Action Step.

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 the Read from Excel File Action Step.

Please note that the return array from the Read from Excel File Action Step is only shown within the same transaction as a Pin Variable. If you would like to use the Array Count in a subsequent transaction, please copy the return array into an array which has previously been created 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 which are available within the Workflow are shown in the drop-down list next to Array to get count of.

Please make sure that the array was previously 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.

In order to test the Workflow, the Workflow Based Variables were 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.