TEXTJOIN
- TEXTJOIN(delimiter, ignore_empty, *string_arrays)[source]
Joins text strings or string arrays with a specified delimiter, optionally ignoring empty values.
This function concatenates multiple strings or string arrays into a single text string. Delimiters can be a single string or an array of strings; if multiple delimiters are provided, they are applied cyclically across the inputs. If ignore_empty is True, empty strings are skipped in the concatenation.
- Parameters:
delimiter (
Operand|str) –The string or string array to use as the delimiter between elements.
Supported types:
STRING
STRING_ARRAY
ignore_empty (
Operand|bool) –Boolean flag indicating whether empty strings should be ignored.
Supported types:
BOOLEAN
*string_arrays (
Operand|str) –One or more strings or string arrays to concatenate.
Supported types:
STRING
STRING_ARRAY
- Return type:
- Returns:
A formula representing the concatenated string.
Supported types:
STRING
STRING_ARRAY
- Raises:
ValueError – If no input strings are provided.
ValueError – If delimiter or any input string is not a valid string/string array.
ValueError – If ignore_empty is not BOOLEAN.
Examples
Simple join:
TEXTJOIN(",", True, "a", "b", "c") # Returns "a,b,c"
Join with empty strings ignored:
TEXTJOIN("-", True, "x", "", "y") # Returns "x-y"