Red Gregory

View Original

How The Concat Function Works In Notion

The First Scenario → Below are a few examples of how concat can be used. The first is a scenario where years, months, weeks, days, hours, minutes, seconds and milliseconds are calculated from the birth date of three individuals. At the end of the table, I provide a clean way to present multiple property formulas into one concat expression.

Click to expand

Formulas (other functions used: dateBetween)

Weeks from birth:

concat(prop("Name") + " is " + format(dateBetween(now(), prop("Born"), "weeks"))) + " weeks " + "old" 

Clean concat (last property):

concat(prop("Name") + " is " + format(dateBetween(now(), prop("Born"), "years")) + " years, " + format(dateBetween(now(), prop("Born"), "months")) + " months, " + format(dateBetween(now(), prop("Born"), "weeks")) + " weeks, " + format(dateBetween(now(), prop("Born"), "days")) + " days " + "old") 

The Second Scenario → This scenario showcases a shipping center that wants to create a specific and consistent message layout for to its customers upon ordering their products. They want the following structure to appear: "Your shipment has been fulfilled for the following items: [INSERT ITEMS]. Estimated delivery is [INSERT DAY OF WEEK], [DATE] between 7am and 4pm.

Click to expand

Formulas (other functions used: formatDate)

Message:

concat("Your shipment has been fulfilled for the following items: " + prop("Item(s)")) + "." + " Estimated delivery is " + formatDate(prop("Estimated Arrival"), "dddd") + ", " + format(prop("Estimated Arrival")) + " between 7am and 4pm." 

VIEW EXAMPLES


See this gallery in the original post