Text functions

FlowScript text literals can be written either with a single or double quotes. Textual values can be concatenated using the & operator.

Function

Description

Example Expression

Example Result

Len(input)

Returns the length of the input.

Len("Hello")

5

Left(input, count)

Returns the first count characters of the string.

Left("Hello", 2)

"He"

Right(input, count)

Returns the last count characters of the string.

Right("Hello", 1)

"o"

Mid(input, start, count)

Returns the substring starting at start and continuing count characters. The start parameter is 0-based: the first character has index 0, the second 1 and so on.

Mid("Hello", 1, 3)

"ell"

Trim(input)

Removes whitespace characters before and after the string.

Trim(" Hello ")

"Hello"

InStr(input, search)

Returns the 0-based index of the first occurrence of the search string within input, or -1 if the substring is not found.

InStr("Hello", "e")

1

Upper(input)

Returns an all uppercase version of the input.

Upper("Hello")

"HELLO"

Lower(input)

Returns an all lowercase version of the input.

Lower("Hello")

"hello"

Replace(input, search, replacement)

Replaces all instances of the search string in input with replacement.

Replace("Hello", "e", "u")

"Hullo"

RegexMatch(input, pattern)

Return a truth (Boolean) value indicating whether the given Regular Expression pattern matches the input.

RegexMatch("123", "\d{3}")

TRUE

RegexReplace(input, pattern, replacement)

Performs a Regular Expression replace on the input string, returning the result.

RegexReplace("2hello1", "\d", "X")

"XhelloX"

Chr(code)

Returns the given Unicode character code as a string.

Chr(9)

<the TAB character>

Guid()

Returns a new Globally Unique Identifier: a random string with a very low chance of ever being returned again by subsequent calls to the same function.

Guid()

<a unique identifier>

Split(input, delimiter)

Divides the input string into substrings separated by the delimiter, returning a new table variable with a single value column containing the sub-strings. Note that the delimiter argument must be exactly one character long.

Split("2,89,16", ",")

<a table variable with one "value" column, containing three rows: value = 2, value = 89 and value = 16>

IsNull(input, replacement)

Replaces empty input values with the specified replacement value. If the input value is not empty will the value not be replaced.

IsNull("", 0)

0

DecodeText(input, encoding)

Decodes text encoded as binary data (from a BLOB database column or a File Gallery interaction item). The second argument specifies the encoding from which to decode. Valid values for this argument can be found in the "encodings" system variable, which is available in all workflows.

DecodeText(myFile.data, encodings.Windows1252)

<contents of myFile.data, decoded using the Windows 1252 Character Set>

Last updated