Text
Mar 06, 2023 • 4 minutes to readText includes string manipulation and static constants including substring, trim, and concatenate operations.
Text field
Holds a string of characters that represent a fixed value. It is often used to initialize variables or set static values to the table record, or define the criteria for the action block.
Text area
Holds a string of characters that represent a fixed value. As a text field, it is often used to initialize variables or set static values to the table record, or define the criteria for the action block.
Length of
Returns the length of the string. For example, the length of the string “Caspio” is 6.
In… replace… with…
Replaces all occurrences of a substring within a string with a new substring. For example, you can replace “r” with “b” in the word “bed”, resulting in “red”.
In… get… characters
In… get… characters can be used in two ways. It can extract the specified number of characters from the string starting from left or right. For example, the last two characters from “Caspio” is “io”.
When used with substring from/between, it returns a substring starting with the specified position and length. For example, a substring of four symbols starting from the 5th symbol in “Mississippi” is “issi” and the substring between the 5th and 9th symbol in “Mississippi” is “issi”.
The above triggered action extracts domain from an email address. For example, for administrator@caspio.com the domain is caspio.com.
Trim… spaces of…
Removes leading and trailing (or both) spaces from a string. For example, the trimmed string from “ Caspio! ” is “Caspio!”.
Find pattern/substring
Find pattern
Find pattern returns the position of a first occurrence of the pattern in a string. The first position in a string is always 1. If the pattern is not found, 0 is returned. The search is case-insensitive.
The pattern must include wildcards %. Beside %, other wildcards can be used in a pattern:
- % – Match any string of any length (including 0 length)
- _ – Match one single character
- [] – Match any characters in the brackets, e.g. [xyz]
- [^] – Match any character not in the brackets, e.g. [^xyz]
For example, pattern %sp% in the string “Caspio” is 3.
As an administrator, I would like to get notified about any operation that is rejected. The above triggered action verifies whether the inserted data contains the substring “Rejected” in the Details column, indicating an error has occurred. Consequently, the check_status is set to either true or false, and an email is sent only if the status is true.
Find substring
Find substring searches for a substring in a string and returns the position of its first occurrence. The first position in a string is always 1. If the substring is not found, 0 is returned. The search is case-insensitive.
You can specify the starting position for the search, for example, start searching from position 3. For example, the position of the “ss” substring in “Mississippi” is 3 and the position of the “ss” substring in “Mississippi” starting from 4 is 6.
The above triggered action extracts domain from an email address. For example, for administrator@caspio.com the domain is caspio.com.
Uppercase/Lowercase
Converts the text to UPPERCASE or lowercase.
Concatenate
Concatenate is used to join together 2 or more strings. For example, concatenate of “Caspio” and “Platform” will be “CaspioPlatform”.
The above triggered action builds the email notification recipients list by concatenating email addresses from table CRM_Contact. If the list of recipients exceeds the limit of 1000 characters, the e-mail is sent, the variable is reset, and further records are added to the cleared variable. As a result, all contacts receive the message with the least possible number of e-mails.