BEGINS
Use the BEGINS function to check if text begins with specific characters and returns TRUE if it does.
Use
BEGINS( text, begin_text )
Checks to see the first text value begins with the second text value.
| Parameter | Required | Description |
|---|---|---|
| text | Yes | the text to test |
| begin_text | Yes | the text to search for at the beginning of text |
| Returns | Logical |
Example
Validation Logic for Standardized IDs
In an approval for project funding, you may want to ensure that every Project ID entered on a form starts with a specific departmental prefix, such as "PROJ-". This is implemented as an Output Validation Formula.
- Formula:
ASSERT(BEGINS(this, "PROJ-"), "Project IDs must start with the 'PROJ-' prefix.") - Logic:
this: Refers to the current value of the Project ID field being validated.BEGINS(this, "PROJ-"): This core function checks if the first five characters of the input are "PROJ-".ASSERT: If theBEGINSfunction returns FALSE, theASSERTfunction triggers the specific error message to guide the user.
Conditional Logic for Form Visibility
You can use BEGINS in the Form Builder to create Conditional Logic. This allows you to show or hide parts of a form based on what a user types into a preceding field.
- Scenario: You want to show a special "Urgent Processing" checkbox only if a Request Code starts with the letter "U".
- Formula (applied to the "Show when" property of a form element):
BEGINS(@Trigger.out.RequestCode, "U") - Logic:
@Trigger.out.RequestCode: This identifies the specific output data item from the trigger step.- "Show when": Because the formula returns TRUE when the string starts with "U", the form element will automatically appear for the user only when that condition is met.