Program Functions, Database

Notion Guide: How To Extract Characters From A Title

Screen Shot 2021-01-18 at 2.51.31 PM.png

🪓 Extract Characters

If you are importing a large file into Notion, there may be a scenario where bulk extraction of certain characters is necessary. The following list of are different ways to modify a title using regular expressions in a Notion formula. The function used primarily is replaceAll.

What You Need In Your Notion Database:

  • A title property filled out (labeled “Name”)

  • A formula property to plug in one of these formulas

Extract All Number Sequences

Screen Shot 2021-01-18 at 1.43.18 PM.png

replaceAll(prop("Name"), "([^0-9]+)([^0-9]+)", "")

Extract All Text Sequences

Screen Shot 2021-01-18 at 1.47.00 PM.png

replaceAll(prop("Name"), "([^A-z]+)([^A-z]+)", "")

Extract All Characters After A Special Character

Screen Shot 2021-01-18 at 12.22.09 PM.png

replaceAll(prop("Name"), ".*[:] ", "")

Extract All Characters Before A Special Character

Screen Shot 2021-01-18 at 2.17.37 PM.png

replaceAll(prop("Name"), "[:].+", "")

Extract Last Word In A String

Screen Shot 2021-01-18 at 1.00.46 PM.png

replaceAll(prop("Name"), ".*[^A-z]", "")

Extract First Word In A String

Screen Shot 2021-01-18 at 1.20.01 PM.png

replaceAll(prop("Name"), "[^A-z].+", "")

Extract All Characters Between Two Characters

Screen Shot 2021-01-18 at 2.41.50 PM.png

replaceAll(replace(prop("Name"), "[^(]*[(]", ""), "[)][^)]*$", "")

Extra: How To Replace Title With Formula Column

Copy + Paste the formula column into the Title by clicking any cell and clicking away from the formula popup window. Then click from the top cell and drag down to the bottom.

Untitled_Artwork 40.png

This is a set of basic formulas that may help you import complicated data into Notion easily. All the best with your workspace endeavours.

 

Further Reading