Skip to main content

MATCH

Use the MATCH function to search for the specified value in an array and return the relative position of that value. The search is case-insensitive and can include wildcard characters question mark (?) and asterisk (*). A question mark matches any single character; an asterisk matches any sequence of characters. If you want to find an actual question mark or asterisk, type a tilde (~) before the character.

Use​

MATCH( value, array )
Searches for a specified value in an array and returns the relative position of that value.

ParameterRequiredDescription
valueYesthe value to search for, including wildcards ? and *
arrayYesthe array to search

ReturnsNumber

Examples​

Priority Score Assignment (Input Mapping)​

In an Input Mapping Formula, you can use MATCH to determine the rank of a value within a predefined list to assign a numerical priority score to a subsequent step.

  • Scenario: A company has a Constant Array called #PriorityLevels containing {"Low", "Medium", "High", "Critical"}. When a user submits a request, you want to record the numerical rank of the priority they selected.
  • Formula: MATCH(@Trigger.out.UserPriority, #PriorityLevels)
  • Logic:
    • If the user selects "High", the function returns 3 because it is the third item in the array.
    • This number can then be mapped to an activity property, such as Score As, to help measure approval results.

Date Exclusion Validation (Validation Logic)​

You can use MATCH in an Output Validation Formula to ensure a user does not select a date that falls on a restricted day, such as a company holiday.

  • Scenario: A user is selecting a "Deployment Date." The system must prevent the user from choosing a date that exists in a Constant Array of company holidays called #PublicHolidays.
  • Formula: ASSERT(MATCH(this, #PublicHolidays) = 0, "The selected date is a public holiday and cannot be used for deployment.")
  • Logic:
    • this: Refers to the date the user has currently selected in the capture widget.
    • MATCH(...): If the selected date is found in the #PublicHolidays list, the function returns its position (e.g., 5). If it is not found, it returns 0 (or an error depending on the exact system behavior, but for validation purposes, we check if a match exists).
    • Result: The ASSERT function triggers the error message if the date is found in the holiday list.

Pro Tip: Using Wildcards
The MATCH function is unique because it supports the asterisk (*) for a sequence of characters and the question mark (?) for a single character. For instance, MATCH("PROJ*", #ProjectList) would find the position of the first project code starting with "PROJ," regardless of the characters that follow. To search for an actual asterisk or question mark, you must type a tilde (~) before the character.