The join()
function takes its first argument and inserts it in between each of its additional arguments. It accepts only string arguments.
join(string, string, string)
join()
can accept one or more arguments, but needs at least three to perform its intended function.
join()
acts much like JavaScript’s Array.prototype.join() method, with all but the first argument acting as the elements inside an array. Note that Notion’s join()
function does not use a default separator (e.g. ,
), so you’ll always need to define one.
Example Formulas
join(", ","Luffy","Zoro","Nami","Chopper")
// Output: Luffy, Zoro, Nami, Chopper
// Use "\n" to add line breaks
join("\n","Luffy","Zoro","Nami","Chopper")
// Output:
// Luffy
// Zoro
// Nami
// Chopper
Example Database
This example database creates a roster for different missions. Each member in the pirate crew can mark whether or not they’re attending, and the Roster formula will output a list of those attending and not attending.
The join()
function is used to create line breaks.

View and Duplicate Database

“Roster” Property Formula
// Compressed
join("\n", (prop("Luffy") == true) ? "Luffy attending" : "Luffy not attending", (prop("Sanji") == true) ? "Sanji attending" : "Sanji not attending", (prop("Zoro") == true) ? "Zoro attending" : "Zoro not attending", (prop("Chopper") == true) ? "Chopper attending" : "Chopper not attending")
// Expanded
join(
"\n",
(prop("Luffy") == true) ? "Luffy attending" : "Luffy not attending",
(prop("Sanji") == true) ? "Sanji attending" : "Sanji not attending",
(prop("Zoro") == true) ? "Zoro attending" : "Zoro not attending",
(prop("Chopper") == true) ? "Chopper attending" : "Chopper not attending"
)
This join()
example inserts "\n"
between each string to create line breaks.
“Roster Pretty” Property Formula
For fun, here’s another take on the Roster formula that uses replace and replaceAll – along with some advanced regular expressions – to create a single sentence that includes only the members who are attending (complete with commas):
// Compressed
replace(replace(replace(replaceAll(join(", ", (prop("Luffy") == true) ? "Luffy" : "", (prop("Sanji") == true) ? "Sanji" : "", (prop("Zoro") == true) ? "Zoro" : "", (prop("Chopper") == true) ? "Chopper" : ""), "(^, | ,)", ""), "[,].$", ""), ",(?!.*,)", ", and"), "^([^,]*), and", "$1 and")
// Expanded
replace(
replace(
replace(
replaceAll(
join(
", ",
(prop("Luffy") == true) ? "Luffy" : "",
(prop("Sanji") == true) ? "Sanji" : "",
(prop("Zoro") == true) ? "Zoro" : "",
(prop("Chopper") == true) ? "Chopper" : ""
), "(^, | ,)", ""
), "[,].$", ""
), ",(?!.*,)", ", and"
), "^([^,]*), and", "$1 and"
)
Other formula components used in this example:


