Skip to main content

LEN

Use the LEN function to find the number of characters in a Text value.

Use​

LEN( text )
Returns the number of characters in a text value.

ParameterRequiredDescription
textYesthe text to return length of

ReturnsNumber

Examples​

Output Validation (Enforcing Character Limits)​

You can use the LEN function in an Output Validation Formula to ensure that a user provides a sufficient amount of information or stays within a required character count.

  • Scenario: A "Project Description" field on a trigger form must be at least 20 characters long to ensure enough detail is provided.
  • Formula: ASSERT(LEN(this) >= 20, "Please provide a more detailed description (minimum 20 characters).")
  • Logic:
    • this: Refers to the text currently being entered into the description field.
    • LEN(this): Calculates the total character count of that text.
    • ASSERT: If the length is less than 20, the function returns FALSE and displays the custom error message to the user.

Conditional Routing (Based on ID Length)​

The LEN function can be used within a Path Condition Formula on a Branch step to route an approval based on the format of an identifier.

  • Scenario: Your organization uses two types of "Department Codes." Local codes are 4 characters long (e.g., "FIN1"), while international codes are 6 characters long (e.g., "INTFIN").
  • Formula (for the International Path): LEN(@Trigger.out.DeptCode) = 6
  • Logic:
    • @Trigger.out.DeptCode: Pulls the text string provided by the user in the trigger step.
    • LEN(...): Counts the characters in that string.
    • Result: If the user enters a 6-character code, the formula returns TRUE, and the workflow follows the specific path designed for international approvals.