String functions
This article explains various string functions that can be used in formula fields.
This cheat sheet provides a quick reference guide for various string based functions commonly used in data analysis and programming. Each function is accompanied by its syntax, a sample usage, and a brief description.
CONCAT
The CONCAT function concatenates one or more strings into a single string.
Syntax
Sample
LEFT
The LEFT function retrieves the first 'n' characters specified from the beginning of the input string.
Syntax
Sample
LEN
The LEN function calculates and returns the total number of characters present in the provided string.
Syntax
Sample
LOWER
The LOWER function transforms all characters in the input string to lowercase
Syntax
Sample
MID
The MID function retrieves a substring from the input string starting at the specified position and extending for the specified count of characters.
Syntax
Sample
REGEX_EXTRACT
The REGEX_EXTRACT function searches the input string for the first occurrence of the specified regular expression pattern and returns the matched substring.
Syntax
Sample
REGEX_MATCH
The REGEX_MATCH function evaluates whether the input string matches the specified regular expression pattern, returning 1 if there is a match and 0 if there is no match.
Syntax
Sample
REGEX_REPLACE
The REGEX_REPLACE function identifies all occurrences of the specified regular expression pattern in the input string and substitutes them with the provided replacement string.
Syntax
Sample
REPEAT
The REPEAT function duplicates the provided string the specified number of times, facilitating the creation of repeated patterns or sequences.
Syntax
Sample
REPLACE
The REPLACE function identifies all instances of a particular substring within the given string and substitutes them with another specified substring.
Syntax
Sample
RIGHT
The RIGHT function retrieves the last 'n' characters from the end of the input string, allowing you to extract a substring starting from the right.
Syntax
Sample
SEARCH
The SEARCH function identifies the position of the specified substring within the input string, returning the index if found, and 0 otherwise.
Syntax
Sample
SUBSTR
The SUBSTR function extracts a substring from the input string, starting at the specified position and optionally extending for the specified count of characters.
Syntax
Sample
TRIM
The TRIM function eliminates any leading or trailing whitespaces from the input string.
Syntax
Sample
UPPER
The UPPER function transforms all characters in the input string to uppercase.
Syntax
Sample
URL
The URL function checks if the input string is a valid URL and converts it into a hyperlink
Syntax
Sample
URLENCODE
The URLENCODE function percent-encodes special characters in a string so it can be substituted as a query parameter into a URL.
It is similar to JavaScript encodeURIComponent()
function, except it encodes
only characters that have a special meaning according to RFC 3986 section 2.2
and also percent signs and spaces; other characters such as letters from
non-Latin alphabets will not be encoded. Like encodeURIComponent()
, it should
be used only for encoding URL components, not whole URLs.
Syntax
Sample
ISBLANK
The ISBLANK function checks if a given input is not empty or null, returning FALSE if the input has a value, and TRUE otherwise.
Syntax
Sample
ISNOTBLANK
The ISNOTBLANK function checks if a given input is not empty or null, returning TRUE if the input has a value, and FALSE otherwise.