You are here:
Omnistudio String Functions
Functions that operate on strings.
- Omnistudio BASE64ENCODE Function
Encodes an input value into Base64 format. - Omnistudio CONCAT Function
Concatenates two or more strings into a single string. - Omnistudio JOIN Function
Joins two or more string into a single string, separating each string by a specified token. - Omnistudio MAXSTRING Function
Returns the string that is last lexicographically in a list of two or more strings. - Omnistudio SPLIT Function
Splits a string into substrings at each position of a specified token. - Omnistudio STRINGINDEXOF Function
Returns the start index of a substring within a string. - Omnistudio SUBSTRING Function
Returns a substring of a string based on specified start and end indexes. - Omnistudio TOSTRING Function
Converts input data into a string.
Omnistudio BASE64ENCODE Function
Encodes an input value into Base64 format.
Base64 is a common ASCII-based encoding. In an encoded result, trailing =
characters are padding.
Signature
BASE64ENCODE(data)
Return Value
String
Parameters
Parameter |
Data Type |
Necessity |
Description |
|---|---|---|---|
|
Any data type |
Required |
The input value to be encoded into Base64 format. The function does not accept a null value or an empty string. |
Formula: BASE64ENCODE("Encode this string.")
Return value: "RW5jb2RlIHRoaXMgc3RyaW5nLg=="
Formula: BASE64ENCODE("2003-02-01T16:35:30-0500")
Return value: "MjAwMy0wMi0wMVQxNjozNTozMC0wNTAw"
Formula: BASE64ENCODE(1024)
Return value: "MTAyNA=="
Sample data:
"Contact": {
"FirstName": "Thomas",
"MiddleName": "Alva",
"LastName": "Edison"
}
Formula: BASE64ENCODE(Contact)
Return value: "e0xhc3ROYW1lPUVkaXNvbiwgTWlkZGxlTmFtZT1BbHZhLCBGaXJzdE5hbWU9VGhvbWFzfQ=="
Omnistudio CONCAT Function
Concatenates two or more strings into a single string.
Signature
CONCAT(string...)
Return Value
String
Parameters
Parameter |
Data Type |
Necessity |
Description |
|---|---|---|---|
|
String |
Required |
A comma-separated list of one or more strings to be concatenated into a single string. To
separate input strings in the result, include a separator string (such as If you specify only a single string, the function returns that string. If you specify multiple strings, the function ignores null values and empty strings. You cannot specify a null value or an empty string as the only input value. |
Formula: CONCAT("AGE", ": ", 23)
Return value: "AGE: 23"
Formula: CONCAT(23, " years of age")
Return value: "23 years of age"
Sample data:
"stringField1": "abc",
"stringField2": "ABC"
Formula: CONCAT(%stringField1%, " ", %stringField2%)
Return value: "abc ABC"
Sample data:
"Contact": {
"FirstName": "Mike",
"LastName": "Smith"
}
Formula: CONCAT(Contact:FirstName, " ", Contact:LastName)
Return value: "Mike Smith"
Omnistudio JOIN Function
Joins two or more string into a single string, separating each string by a specified token.
Signature
JOIN(string..., token)
Return Value
String
Parameters
Parameter |
Data Type |
Necessity |
Description |
|---|---|---|---|
|
String |
Required |
A comma-separated list of one or more strings to be joined into a single string. In the joined string, each specified string is separated by the token. You can join numbers, which the function coerces into strings. If you specify only a single string and a token, the function returns only the string. If you specify multiple values and any are null, the function omits the null values from the joined string. If you specify multiple values and any are empty strings, the function joins only the values that precede the empty string. You cannot specify a null value or an empty string as the only input value. |
|
String |
Required |
A value to be placed between each input string at the position at which the strings are joined. If you specify a number, the function coerces it into a string. If you specify an empty string, the function omits the empty string from the joined string. If you specify multiple input strings and no token, the function uses the last value of the input as the token. |
Sample data: "AlphabeticArray": [ "a", "A", "b", "B", "c", "C" ]
Formula: JOIN(AlphabeticArray, ", ")
Return value: "a, A, b, B, c, C"
Sample data: "NumericArray": [ 1, 2, 3, 4 ]
Formula: JOIN(NumericArray, " / ")
Return value: "1 / 2 / 3 / 4"
Sample data:
"Contact": {
"FirstName": "Thomas",
"MiddleName": "Alva",
"LastName": "Edison"
}
Formula: JOIN(Contact:FirstName, Contact:MiddleName, Contact:LastName, " ")
Return value: "Thomas Alva Edison"
Sample data:
"Contacts": [
{
"id": "0036ab",
"lastName": "Jones",
"firstName": "Cathy"
},
{
"id": "2787kq",
"lastName": "Smith",
"firstName": "Albert"
},
{
"id": "3610xr",
"lastName": "Smith",
"firstName": "Ben"
}
]
Formula: JOIN(Contacts:id, ', ')
Return value: "0036ab, 2787kq, 3610xr"
Formula: JOIN("a", "b", "c")
Formula: JOIN(("a", "b", "c"))
Return value: "acb"
Omnistudio MAXSTRING Function
Returns the string that is last lexicographically in a list of two or more strings.
The function performs case-sensitive comparisons of the input strings.
Signature
MAXSTRING(string...)
Return Value
String
Parameters
Parameter |
Data Type |
Necessity |
Description |
|---|---|---|---|
|
String |
Required |
Two or more strings from which the string that is last lexicographically is to be returned. If you specify numbers, the function coerces them into strings. If you specify only a single string, the function returns that string. If you specify multiple strings, the function ignores null values and empty strings. You cannot specify a null value or an empty string as the only input value. |
Formula: MAXSTRING("Amy", "Ziggy", "Michael")
Return value: "Ziggy"
Formula: MAXSTRING(1, 2, 3)
Return value: "3"
Formula: MAXSTRING("A", "B", "C")
Return value: "C"
Formula: MAXSTRING("A", "b", "C")
Return value: "b"
Omnistudio SPLIT Function
Splits a string into substrings at each position of a specified token.
The function performs a case-sensitive search for the token. If it splits the input string into two or more substrings, the function returns an array of strings. Otherwise, it returns the input string.
Signature
SPLIT(string, token)
Return Value
String[]
Parameters
Parameter |
Data Type |
Necessity |
Description |
|---|---|---|---|
|
String |
Required |
The string to be split into substrings. If you specify a number, the function coerces it into a string. The string cannot be null or an empty string. |
|
String |
Required |
A string that specifies the position at which the input string is to be split into
substrings. The token is interpreted as a Java regular expression (regex) pattern. Special
regex characters such as If you specify a null token, the function returns the input string. If you specify an empty string as the token, the function returns an array that includes each character of the input value. |
Sample data: %Name% == "Anne Marie Gupta"
Formula: SPLIT(%Name%, " ")
Return value: [ "Anne", "Marie", "Gupta" ]
Formula: SPLIT(12345, 3)
Return value: [ "12", "45" ]
Formula: SPLIT("abcde", "C")
Return value: "abcde"
Omnistudio STRINGINDEXOF Function
Returns the start index of a substring within a string.
The function performs a case-sensitive search for the substring. The position of the first
character in the string is 0. If the substring occurs multiple times in the
string, the function returns the index of the first occurence. If it doesn't find the substring
in the string, the function returns -1.
Signature
STRINGINDEXOF(string, substring)
Return Value
Integer
Parameters
Parameter |
Data Type |
Necessity |
Description |
|---|---|---|---|
|
String |
Required |
The string in which to search for the |
|
String |
Required |
The substring for which to search in the |
Formula: STRINGINDEXOF("This is the test string.", "test")
Return value: 12
Formula: STRINGINDEXOF("This is the test string.", "testy")
Return value: -1
Formula: STRINGINDEXOF("The string of strings.", "string")
Return value: 4
Formula: STRINGINDEXOF(1234, 34)
Return value: 2
Omnistudio SUBSTRING Function
Returns a substring of a string based on specified start and end indexes.
The position of the first character in the string is 0.
The position of the last character in the string is the length of the string.
The function performs a case-sensitive search for a character or string used as a start or end
index.
Signature
SUBSTRING(string, startIndex, endIndex)
Return Value
String
Parameters
Parameter |
Data Type |
Necessity |
Description |
|---|---|---|---|
|
String |
Required |
The string from which a substring is to be returned. The string cannot be null or an empty string. |
|
Integer or string |
Optional |
The position of the first character in the substring. The start index is inclusive,
so the position of the fist character is
If you omit a start index, the function uses |
|
Integer or string |
Optional |
The position of the last character in the substring. The end index is exclusive, so the position of the last character is the length of the string.
If you omit an end index, the function uses the length of the string by default. If you specify an end index, you must also specify a start index. |
Sample data: "InputString": "The string."
Formula: SUBSTRING(InputString)
Return value: "The string."
Sample data: "InputString": "The string."
Formula: SUBSTRING(InputString, 4)
Return value: "string."
Sample data: "InputString": "The string."
Formula: SUBSTRING(InputString, 0, 11)
Return value: "The string."
Sample data: "InputString": "The string."
Formula: SUBSTRING(InputString, 0, 4)
Return value: "The "
Sample data: "InputString": "The string."
Formula: SUBSTRING(InputString, 4, 10)
Return value: "string"
Sample data: "InputString": "The string."
Formula: SUBSTRING(InputString, "r")
Return value: "ring."
Sample data: "InputString": "The string."
Formula: SUBSTRING(InputString, "r", ".")
Return value: "ring"
Sample data: "InputString": "The string."
Formula: SUBSTRING(InputString, "string")
Return value: "string."
Sample data: "InputString": "The string."
Formula: SUBSTRING(InputString, "The", "ring.")
Return value: "The st"
Formula: SUBSTRING("The string of strings.", "The", "ring")
Return value: "The st"
Omnistudio TOSTRING Function
Converts input data into a string.
Signature
TOSTRING(data)
Return Value
String
Parameters
Parameter |
Data Type |
Necessity |
Description |
|---|---|---|---|
|
Any data type |
Required |
The data to be converted into a string. The function does not accept a null value or an empty string. |
Formula: TOSTRING(3.0)
Return value: "3.0"
Formula: TOSTRING({ "key": "value" })
Return value: "key, value"
Formula: TOSTRING({ "Amount": 750.00 })
Return value: "Amount, 750.00"
Formula: TOSTRING('{ "key": "value" }')
Return value: "{ \"key\": \"value\" }"
Formula: TOSTRING([ { "key1": "value1" }, { "key2": "value2" } ])
Return value: "key1, value1, key2, value2"

