TEXTJOIN
joins strings or arrays of strings using a specified delimiter.
Function category: Text​
TEXTJOIN(arg1, arg2, arg3, [arg4])
Arguments | Description |
| Delimiter used to join text. |
| A Boolean value which determines if |
| String or array of strings. |
| Optional. String or array of strings. |
Let's say we're given a response with the following list of car manufacturers for a given part.
{"data":{"parts":{"part_1":["Toyota","Hyundai","Kia","Mercedes Benz"],"part_2":["BMW","","Mercedes Benz","","Ford","","Tesla"]}}}
If we want to compile an easier to read version of the distributors for a given part, use the following function.
# Compile to a readable version of partsTEXTJOIN(", ", TRUE, data.parts.part_1)​# Returns "Toyota, Hyundai, Kia, Mercedes Benz"
If we try to parse part_2
with arg2
set to true
, it will remove any blanks.
# Ignore empty string valuesTEXTJOIN(", ", TRUE, data.parts.part_2)​# Returns "BMW, Mercedes Benz, Ford, Tesla"
If we try to parse part_2
with arg2
set to FALSE
, it will retain any blanks.
# Include empty string valuesTEXTJOIN(", ", FALSE, data.parts.part_2)​# Returns "BMW, , Mercedes Benz, , Ford, , Tesla"