length (array)
  • 23 May 2023
  • Dark
    Light
  • PDF

length (array)

  • Dark
    Light
  • PDF

Article summary

length (array) Task Purpose

The length (array) task is used to return the number of elements in a given array. The return value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. By unsigned, the value represents only non-negative integers.

Potential Use Case

Every failed login attempt on your device stores the username and timestamp in an array. Your company's password attempt policy stipulates a maximum of 3 failed attempts within a specific timeframe. The length (array) task will provide the number of login attempts for subsequent workflow processing.

Properties

Input and output properties are shown below.

Incoming Type Description
arr array (required) The array to get the length of.


Outgoing Type Description
length number Expressed as a numerical value, this is the number of items in the array.

Examples

In the IAP examples shown below:

  • The Reference task and Reference variable set for the length (array) task is job and arr, respectively. As an option, you can toggle the Run Window slider to set the task to run on a schedule.

    lengthArray-01

  • The array variables are set prior to running the workflow.

    lengthArray-02

  • Once you run the workflow, the incoming variables that were set are displayed under the Incoming tab in Task History, which is accessed from Jobs (Operations Manager).

    lengthArray-03

  • This output example returns the length of the array.

    lengthArray-04


Was this article helpful?

What's Next
Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.