Skip to main content

COUNT

Use the COUNT function to count the number of items in a Text, Number or Choice array that are numbers. Numbers are actual numbers, like 12 or 102 or text that contains only numbers, such as "123" or "99.99".

Use​

COUNT( array )
Counts how many numbers are in the array.

ParameterRequiredDescription
arrayYesa text, number or choice array

ReturnsNumber

Examples​

Validation Logic (Ensuring Numeric Integrity)​

You can use COUNT in an Output Validation Formula to ensure that a user has provided numeric data in a field that normally accepts general text.

  • Scenario: You have a Text Array named SerialNumbers where users must enter a list of codes. You want to ensure they haven't accidentally included non-numeric characters.
  • Formula: COUNT(this) = COUNTALL(this)
  • Logic:
    • this: Refers to the SerialNumbers array being validated.
    • COUNT(this): Returns the number of items in the array that are actual numbers or numeric text.
    • COUNTALL(this): Returns the total number of items in the array, including non-numeric text and blanks.
    • Outcome: If the counts match, the formula returns TRUE, indicating every entry is numeric. If the user enters a value like "A123", it is not counted by COUNT, causing the formula to return FALSE and mark the field as invalid.

Path Condition (Routing Based on Data Volume)​

This function can be used in a Path Condition formula on a Branch step to determine the direction of an approval based on the quantity of numeric entries provided.

  • Scenario: A trigger form collects a list of ClaimAmounts in a Number Array. If the user provides more than three actual numeric entries, the request must go to a "Senior Auditor"; otherwise, it follows the "Standard Path."
  • Formula: COUNT(@Trigger.out.ClaimAmounts) > 3
  • Logic:
    • @Trigger.out.ClaimAmounts: Accesses the array data captured when the approval started.
    • COUNT(...): Returns a Number representing how many entries in that array are valid numbers.
    • Outcome: If the array contains four or more numbers, the condition is TRUE, and the workflow routes to the Senior Auditor.